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

Improve mutation determination #3269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justin-tay
Copy link
Collaborator

Description

Instead of attempting to guess if the query text is a mutation by checking the starting characters of the line parse the Document as the GraphQLEntityProjectionMaker is going to need it anyway to make the GraphQLProjectionInfo. It is then simple to check if the mutation operation is present in the Document.

Motivation and Context

This for instance allows handling of cases where a fragment exists before the mutation.

fragment postData on Post {
  id
  title
  text
  author {
    username
    displayName
  }
}
mutation addPost($post: AddPostInput!) {
  addPost(input: [$post]) {
    post {
      ...postData
    }
  }
}

How Has This Been Tested?

Modified the appropriate unit tests.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

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.

None yet

1 participant