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(graphql): get raw aspects for assertions, allow aspectNames filter #9792

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,9 @@ private void configureAssertionResolvers(final RuntimeWiring.Builder builder) {
? assertion.getDataPlatformInstance().getUrn()
: null;
}))
.dataFetcher("runEvents", new AssertionRunEventResolver(entityClient)));
.dataFetcher("runEvents", new AssertionRunEventResolver(entityClient))
.dataFetcher(
"aspects", new WeaklyTypedAspectsResolver(entityClient, entityRegistry)));
}

private void configurePolicyResolvers(final RuntimeWiring.Builder builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public class WeaklyTypedAspectsResolver implements DataFetcher<CompletableFuture
private static final JacksonDataCodec CODEC = new JacksonDataCodec();

private boolean shouldReturnAspect(AspectSpec aspectSpec, AspectParams params) {
return !params.getAutoRenderOnly() || aspectSpec.isAutoRender();
return (params.getAutoRenderOnly() == null
|| !params.getAutoRenderOnly()
|| aspectSpec.isAutoRender())
&& (params.getAspectNames() == null
|| params.getAspectNames().isEmpty()
|| params.getAspectNames().contains(aspectSpec.getName()));
}

@Override
Expand Down
12 changes: 12 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,12 @@ input AspectParams {
Only fetch auto render aspects
"""
autoRenderOnly: Boolean

"""
Fetch using aspect names
If absent, returns all aspects matching other inputs
"""
aspectNames: [String!]
}


Expand Down Expand Up @@ -6788,6 +6794,12 @@ type Assertion implements EntityWithRelationships & Entity {
Edges extending from this entity grouped by direction in the lineage graph
"""
lineage(input: LineageInput!): EntityLineageResult

"""
Experimental API.
For fetching extra aspects that do not have custom UI code yet
"""
aspects(input: AspectParams): [RawAspect!]
}

"""
Expand Down
Loading