Skip to content

Conversation

@kaqqao
Copy link
Contributor

@kaqqao kaqqao commented Dec 14, 2022

Fixes #3053

@andimarek
Copy link
Member

Thanks for raising this PR inlcuding test ... I will need to have a deeper look regarding the actual fix if that is the best way, because I think it should have been handled.

@kaqqao
Copy link
Contributor Author

kaqqao commented Dec 15, 2022

The traversal starts from the types and directive definitions, and since schema applied directives aren't reachable from either of those, they get skipped.
Funnily enough, I remember being the one that added directives traversal in the first place years ago, so it only made sense I add the applied directives as well now that they're a thing 😁

final Map<String, GraphQLNamedType> typeMap = schema.getTypeMap();
List<GraphQLSchemaElement> roots = new ArrayList<>(typeMap.values());
roots.addAll(schema.getDirectives());
roots.addAll(schema.getSchemaAppliedDirectives());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me @andimarek - these objects are not in the schema (eg linked by other objects) - they are root level objects

@andimarek andimarek added this pull request to the merge queue Feb 10, 2023
Merged via the queue into graphql-java:master with commit a9cf6e6 Feb 10, 2023
@kaqqao kaqqao deleted the 3053-applied-directive-type-ref branch February 10, 2023 10:03
@dondonz dondonz added this to the 2023 April milestone Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeReferences not resolved in schema applied directives

4 participants