GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Fix #1440 ClassCastException - fragment with wrong input type condition by tinnou · Pull Request #1449 · graphql-java/graphql-java Conversation
Contributor
DescriptionIn cases where a fragment type condition is invalid (say it was an input type instead of a composite type), the I wrote a test to reproduce the issue: def schema = TestUtil.schema(""" type Query { nothing: String } type Mutation { updateUDI(input: UDIInput!): UDIOutput } type UDIOutput { device: String version: String } input UDIInput { device: String version: String } """) def graphQL = GraphQL.newGraphQL(schema).build() def "#1440 when fragment type condition is input type it should return validation error - not classCastException"() { when: def executionInput = ExecutionInput.newExecutionInput() .query(''' mutation UpdateUDI($input: UDIInput!) { updateUDI(input: $input) { ...fragOnInputType __typename } } # fragment should only target composite types fragment fragOnInputType on UDIInput { device version __typename } ''') .variables([input: [device: 'device', version: 'version'] ]) .build() def executionResult = graphQL.execute(executionInput) then: executionResult.data == null executionResult.errors.size() == 1 (executionResult.errors[0] as ValidationError).validationErrorType == ValidationErrorType.InlineFragmentTypeConditionInvalid } and this throws FixThe fix consists of removing the un-necessary casts as they appear to not be needed. I also added an additional test to cover for inline fragments as well. I will do a second PR for the stable branch.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…rong input type condition and overlapping fields are being merged.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
andimarek
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good, but see my comment about the error type
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems wrong or the naming is off: it is not a InlineFragment. 🤔
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh great catch. The
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure ... do it in one ... thanks
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |