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

Add support for field aliases and multiple root fields #39

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

milessabin
Copy link
Member

@milessabin milessabin commented Jan 17, 2020

It is now possible for a query to contain more than one root field as described in the spec discussion linked to in #13. Where the root queries differ only in their arguments they must be renamed using
field aliases (described in section 2.7 of the spec) to ensure that their result fields don't conflict.

Adding the support for renaming revealed a bug in the schema/interpreter composition mechanism which is now fixed.

Adding support for multiple root nodes revealed a bug in the handling of Unique queries where the expected type is nullable. Prior to this commit, if there was no unique match the query would fail incorrectly rather than returning a null value. This is now also fixed.

Fixes #12 and #13.

It is now possible for a query to contain more than root field as
described in the spec discussion linked to in #13. Where the root
queries differ only in their arguments they must be renamed using
field aliases (described in section 2.7 of the spec) to ensure that
their result fields don't conflict.

Adding the support for renaming revealed a bug in the schema/interpreter
composition mechanism which is now fixed.

Adding support for multiple root nodes revealed a bug in the handling of
Unique queries where the expected type is nullable. Prior to this
commit, if there was no unique match the query would fail incorrectly
rather than returning a null value. This is now also fixed.
Copy link
Member

@tpolecat tpolecat left a comment

Choose a reason for hiding this comment

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

This looks good. No real increase in complexity anywhere, which is good validation. 👍

@milessabin milessabin merged commit 3025f8c into master Jan 17, 2020
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.

Add support for field aliases
2 participants