Skip to content

Commit 45e09ca

Browse files
authored
feat(ui): Adding GraphQL queries to fetch entity deprecation status (datahub-project#4614)
1 parent 060f965 commit 45e09ca

File tree

12 files changed

+133
-7
lines changed

12 files changed

+133
-7
lines changed

datahub-graphql-core/src/main/resources/entity.graphql

+1-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ type Container implements Entity {
13921392
domain: Domain
13931393

13941394
"""
1395-
The deprecation status of the dashboard
1395+
The deprecation status of the container
13961396
"""
13971397
deprecation: Deprecation
13981398

datahub-web-react/src/Mocks.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ const dataset1 = {
205205
downstream: null,
206206
health: null,
207207
assertions: null,
208+
deprecation: null,
208209
};
209210

210211
const dataset2 = {
@@ -283,6 +284,7 @@ const dataset2 = {
283284
health: null,
284285
assertions: null,
285286
status: null,
287+
deprecation: null,
286288
};
287289

288290
export const dataset3 = {
@@ -789,6 +791,7 @@ const glossaryTerm1 = {
789791
sourceRef: 'sourceRef',
790792
sourceURI: 'sourceURI',
791793
},
794+
deprecation: null,
792795
} as GlossaryTerm;
793796

794797
const glossaryTerm2 = {
@@ -831,6 +834,7 @@ const glossaryTerm2 = {
831834
],
832835
__typename: 'GlossaryTermProperties',
833836
},
837+
deprecation: null,
834838
isRealtedTerms: {
835839
start: 0,
836840
count: 0,
@@ -922,6 +926,7 @@ const glossaryTerm3 = {
922926
],
923927
__typename: 'GlossaryRelatedTerms',
924928
},
929+
deprecation: null,
925930
__typename: 'GlossaryTerm',
926931
} as GlossaryTerm;
927932

@@ -1010,6 +1015,7 @@ export const dataFlow1 = {
10101015
...dataPlatform,
10111016
},
10121017
domain: null,
1018+
deprecation: null,
10131019
} as DataFlow;
10141020

10151021
export const dataJob1 = {
@@ -1086,6 +1092,7 @@ export const dataJob1 = {
10861092
},
10871093
domain: null,
10881094
status: null,
1095+
deprecation: null,
10891096
} as DataJob;
10901097

10911098
export const dataJob2 = {
@@ -1147,6 +1154,7 @@ export const dataJob2 = {
11471154
domain: null,
11481155
upstream: null,
11491156
downstream: null,
1157+
deprecation: null,
11501158
} as DataJob;
11511159

11521160
export const dataJob3 = {
@@ -1209,6 +1217,7 @@ export const dataJob3 = {
12091217
upstream: null,
12101218
downstream: null,
12111219
status: null,
1220+
deprecation: null,
12121221
} as DataJob;
12131222

12141223
export const mlModel = {
@@ -1284,6 +1293,7 @@ export const mlModel = {
12841293
upstream: null,
12851294
downstream: null,
12861295
status: null,
1296+
deprecation: null,
12871297
} as MlModel;
12881298

12891299
export const mlModelGroup = {
@@ -1347,6 +1357,7 @@ export const mlModelGroup = {
13471357
upstream: null,
13481358
downstream: null,
13491359
status: null,
1360+
deprecation: null,
13501361
} as MlModelGroup;
13511362

13521363
export const recommendationModules = [

datahub-web-react/src/app/entity/shared/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
Container,
2525
Health,
2626
Status,
27+
Deprecation,
2728
} from '../../../types.generated';
2829
import { FetchedEntity } from '../../lineage/types';
2930

@@ -73,6 +74,7 @@ export type GenericEntityProperties = {
7374
container?: Maybe<Container>;
7475
health?: Maybe<Health>;
7576
status?: Maybe<Status>;
77+
deprecation?: Maybe<Deprecation>;
7678
};
7779

7880
export type GenericEntityUpdate = {

datahub-web-react/src/graphql/chart.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ query getChart($urn: String!) {
4747
domain {
4848
...entityDomain
4949
}
50+
deprecation {
51+
...deprecationFields
52+
}
5053
inputs: relationships(input: { types: ["Consumes"], direction: OUTGOING, start: 0, count: 100 }) {
5154
...fullRelationshipResults
5255
}

datahub-web-react/src/graphql/container.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ query getContainer($urn: String!) {
3939
domain {
4040
...entityDomain
4141
}
42+
deprecation {
43+
...deprecationFields
44+
}
4245
}
4346
}

datahub-web-react/src/graphql/dataFlow.graphql

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ fragment dataFlowFields on DataFlow {
3838
status {
3939
removed
4040
}
41+
deprecation {
42+
...deprecationFields
43+
}
4144
}
4245

4346
query getDataFlow($urn: String!) {
@@ -80,6 +83,9 @@ query getDataFlow($urn: String!) {
8083
glossaryTerms {
8184
...glossaryTerms
8285
}
86+
deprecation {
87+
...deprecationFields
88+
}
8389
}
8490
}
8591
}

datahub-web-react/src/graphql/dataJob.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ query getDataJob($urn: String!) {
2828
status {
2929
removed
3030
}
31+
deprecation {
32+
...deprecationFields
33+
}
3134
}
3235
}
3336

datahub-web-react/src/graphql/fragments.graphql

+40-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ fragment glossaryTerms on GlossaryTerms {
2323
}
2424
}
2525

26+
fragment deprecationFields on Deprecation {
27+
actor
28+
deprecated
29+
note
30+
decommissionTime
31+
}
32+
2633
fragment ownershipFields on Ownership {
2734
owners {
2835
owner {
@@ -171,12 +178,6 @@ fragment nonRecursiveDatasetFields on Dataset {
171178
}
172179
}
173180
}
174-
deprecation {
175-
actor
176-
deprecated
177-
note
178-
decommissionTime
179-
}
180181
globalTags {
181182
...globalTagsFields
182183
}
@@ -192,6 +193,9 @@ fragment nonRecursiveDatasetFields on Dataset {
192193
container {
193194
...entityContainer
194195
}
196+
deprecation {
197+
...deprecationFields
198+
}
195199
}
196200

197201
fragment nonRecursiveDataFlowFields on DataFlow {
@@ -222,6 +226,9 @@ fragment nonRecursiveDataFlowFields on DataFlow {
222226
domain {
223227
...entityDomain
224228
}
229+
deprecation {
230+
...deprecationFields
231+
}
225232
}
226233

227234
fragment nonRecursiveDataJobFields on DataJob {
@@ -241,6 +248,9 @@ fragment nonRecursiveDataJobFields on DataJob {
241248
domain {
242249
...entityDomain
243250
}
251+
deprecation {
252+
...deprecationFields
253+
}
244254
}
245255

246256
fragment dataJobFields on DataJob {
@@ -288,6 +298,9 @@ fragment dataJobFields on DataJob {
288298
domain {
289299
...entityDomain
290300
}
301+
deprecation {
302+
...deprecationFields
303+
}
291304
}
292305

293306
fragment dashboardFields on Dashboard {
@@ -336,6 +349,9 @@ fragment dashboardFields on Dashboard {
336349
status {
337350
removed
338351
}
352+
deprecation {
353+
...deprecationFields
354+
}
339355
}
340356

341357
fragment nonRecursiveMLFeature on MLFeature {
@@ -373,6 +389,9 @@ fragment nonRecursiveMLFeature on MLFeature {
373389
status {
374390
removed
375391
}
392+
deprecation {
393+
...deprecationFields
394+
}
376395
}
377396

378397
fragment nonRecursiveMLPrimaryKey on MLPrimaryKey {
@@ -410,6 +429,9 @@ fragment nonRecursiveMLPrimaryKey on MLPrimaryKey {
410429
status {
411430
removed
412431
}
432+
deprecation {
433+
...deprecationFields
434+
}
413435
}
414436

415437
fragment nonRecursiveMLFeatureTable on MLFeatureTable {
@@ -438,6 +460,9 @@ fragment nonRecursiveMLFeatureTable on MLFeatureTable {
438460
status {
439461
removed
440462
}
463+
deprecation {
464+
...deprecationFields
465+
}
441466
}
442467

443468
fragment schemaMetadataFields on SchemaMetadata {
@@ -553,6 +578,9 @@ fragment nonRecursiveMLModel on MLModel {
553578
status {
554579
removed
555580
}
581+
deprecation {
582+
...deprecationFields
583+
}
556584
}
557585

558586
fragment nonRecursiveMLModelGroupFields on MLModelGroup {
@@ -570,6 +598,9 @@ fragment nonRecursiveMLModelGroupFields on MLModelGroup {
570598
status {
571599
removed
572600
}
601+
deprecation {
602+
...deprecationFields
603+
}
573604
}
574605

575606
fragment platformFields on DataPlatform {
@@ -620,6 +651,9 @@ fragment entityContainer on Container {
620651
subTypes {
621652
typeNames
622653
}
654+
deprecation {
655+
...deprecationFields
656+
}
623657
}
624658

625659
fragment entityDomain on Domain {

datahub-web-react/src/graphql/glossaryTerm.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@ query getGlossaryTerm($urn: String!, $start: Int, $count: Int) {
4949
schemaMetadata(version: 0) {
5050
...schemaMetadataFields
5151
}
52+
deprecation {
53+
...deprecationFields
54+
}
5255
}
5356
}

datahub-web-react/src/graphql/mutations.graphql

+4
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ mutation unsetDomain($entityUrn: String!) {
4545
mutation setTagColor($urn: String!, $colorHex: String!) {
4646
setTagColor(urn: $urn, colorHex: $colorHex)
4747
}
48+
49+
mutation updateDeprecation($input: UpdateDeprecationInput!) {
50+
updateDeprecation(input: $input)
51+
}

0 commit comments

Comments
 (0)