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

Support schema without Query type when using federation #1925

Merged
merged 6 commits into from
Aug 24, 2021

Conversation

cappuc
Copy link
Contributor

@cappuc cappuc commented Aug 23, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes

When using federation it is possible to have a schema without the Query type and only types extensions.
With this change it is possible to omit the Query type

Breaking changes

none.

@cappuc cappuc marked this pull request as draft August 23, 2021 16:07
@spawnia
Copy link
Collaborator

spawnia commented Aug 23, 2021

This is not that easy, see graphql/graphql-spec#631

If we make this possible, it should not be limited to Federation. We need to make sure that validation and introspection still work.

@spawnia spawnia added the discussion Requires input from multiple people label Aug 23, 2021
@spawnia
Copy link
Collaborator

spawnia commented Aug 23, 2021

See webonyx/graphql-php#920

@cappuc
Copy link
Contributor Author

cappuc commented Aug 23, 2021

Yes it makes sense to implement it globally but it's more complex because it needs to handle validation and introspection correctly.

With this "federation only" implementation the Query type is always defined with at least _service and _entities queries so the rest of the implementation doesn't need changes.

Anyway I did some tests with apollo gateway and this implementation (only type extension and no root Query) and it seems to works fine

@spawnia spawnia marked this pull request as ready for review August 24, 2021 07:07
@spawnia spawnia merged commit 0cc38f0 into nuwave:master Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Requires input from multiple people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants