Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat)(Business Glossary) glossary term relationship graphql changes #3103

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
}
}
}
}
saxo-lalrishav marked this conversation as resolved.
Show resolved Hide resolved
ownership {
...ownershipFields
}
Expand Down