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

update SDL generation logic to work with applied directives #231

Merged
merged 3 commits into from
Jul 28, 2022

Conversation

dariuszkuc
Copy link
Member

FederationSdlPrinter is a copy of a graphql.schema.idl.SchemaPrinter from graphql-java v17 with some custom filtering logic that was required for Federation v1.

graphql-java v18 introduced concept of applied directive to make a distinction from the directive definition (previously same GraphQLDirective type was used for both). This PR drops our custom copy of the schema printer and instead updates our logic to rely on the built-in schema printer provided by the graphql-java. Using custom predicates for filtering directives and schema elements we can replicate our custom functionality without the need of a custom printer.

Related:

`FederationSdlPrinter` is a copy of a `graphql.schema.idl.SchemaPrinter` from `graphql-java` v17 with some custom filtering logic that was required for Federation v1.

`graphql-java` v18 introduced concept of applied directive to make a distinction from the directive definition (previously same `GraphQLDirective` type was used for both). This PR drops our custom copy of the schema printer and instead updates our logic to rely on the built-in schema printer provided by the `graphql-java`. Using custom predicates for filtering directives and schema elements we can replicate our custom functionality without the need of a custom printer.

Related:

* resolves: apollographql#227
* resolves: apollographql#216
* supersedes: apollographql#223
@dariuszkuc dariuszkuc merged commit 7116f74 into apollographql:master Jul 28, 2022
@dariuszkuc dariuszkuc deleted the schemaPrinterUpdate branch July 28, 2022 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change: patch Bug fixes type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_service query should return non-nullable _Service type Drop FederationSdlPrinter
2 participants