Skip to content

Commit

Permalink
feat(business-glossary): glossary term relationship graphql changes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
saxo-lalrishav authored Aug 18, 2021
1 parent 798e57b commit 24dc67f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public static void configureRuntimeWiring(final RuntimeWiring.Builder builder) {
configureTagAssociationResolver(builder);
configureDataJobResolvers(builder);
configureMLFeatureTableResolvers(builder);
configureGlossaryRelationshipResolvers(builder);
}

public static GraphQLEngine.Builder builder() {
Expand Down Expand Up @@ -749,6 +750,14 @@ private static void configureMLFeatureTableResolvers(final RuntimeWiring.Builder
);
}

private static void configureGlossaryRelationshipResolvers(final RuntimeWiring.Builder builder) {
builder.type("GlossaryTerm", typeWiring -> typeWiring
.dataFetcher("relationships", new AuthenticatedResolver<>(
new EntityRelationshipsResultResolver(GmsClientFactory.getRelationshipsClient())
))
);
}


private static <T> DataLoader<String, DataFetcherResult<T>> createDataLoader(final LoadableType<T> graphType, final QueryContext queryContext) {
BatchLoaderContextProvider contextProvider = () -> queryContext;
Expand Down
8 changes: 7 additions & 1 deletion datahub-graphql-core/src/main/resources/gms.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,14 @@ type GlossaryTermInfo {
Properties of the glossary term
"""
customProperties: [StringMapEntry!]

"""
Schema definition of glossary term
"""
rawSchema: String
}


type DataPlatform implements Entity {
"""
Urn of the data platform
Expand Down Expand Up @@ -939,7 +945,7 @@ type DownstreamEntityRelationships {
type DataFlowDataJobsRelationships {
entities: [EntityRelationshipLegacy]
}

type UpstreamLineage {
"""
List of upstream datasets
Expand Down
26 changes: 25 additions & 1 deletion datahub-web-react/src/graphql/glossaryTerm.graphql
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
query getGlossaryTerm($urn: String!) {
query getGlossaryTerm($urn: String!, $start: Int, $count: Int) {
glossaryTerm(urn: $urn) {
urn
type
name
hierarchicalName
isRealtedTerms: relationships(types: ["IsA"], direction: OUTGOING, start: $start, count: $count) {
start
count
total
relationships {
entity {
... on GlossaryTerm {
urn
}
}
}
}
hasRealtedTerms: relationships(types: ["HasA"], direction: OUTGOING, start: $start, count: $count) {
start
count
total
relationships {
entity {
... on GlossaryTerm {
urn
}
}
}
}
ownership {
...ownershipFields
}
Expand Down

0 comments on commit 24dc67f

Please sign in to comment.