GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Using fragments on the input as outputs doesn't fail in parsing · Issue #1440 · graphql-java/graphql-java

Using fragments on the input as outputs doesn't fail in parsing #1440

New issue
Copy link
New issue
Copy link
Closed
Closed
Using fragments on the input as outputs doesn't fail in parsing#1440
Copy link

Description

@itrestian
itrestian
opened on Mar 2, 2019
Issue body actions

Describe the bug

In the following mutation call, we're defining a fragment on the UDIInput input. The fragment is called UDIInputFields and if this is a fragment on the input, it cannot be used as an output. If we use it in the output such as below, query parsing succeeds, however query execution fails with the exception below.

mutation UpdateUDI($crd: UserCreds!, $input: UDIInput!) { 
updateUDI(crd: $crd, input: $input) { 
...UDIInputFields 
__typename 
} 
} 

fragment UDIInputFields on UDIInput { 
device
version 
__typename 
} 
graphql.schema.GraphQLInputObjectType cannot be cast to graphql.schema.GraphQLOutputType
java.lang.ClassCastException: graphql.schema.GraphQLInputObjectType cannot be cast to graphql.schema.GraphQLOutputType
	at graphql.validation.rules.OverlappingFieldsCanBeMerged.collectFieldsForFragmentSpread(OverlappingFieldsCanBeMerged.java:308) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.rules.OverlappingFieldsCanBeMerged.collectFields(OverlappingFieldsCanBeMerged.java:294) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.rules.OverlappingFieldsCanBeMerged.leaveSelectionSet(OverlappingFieldsCanBeMerged.java:58) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.RulesVisitor.leaveSelectionSet(RulesVisitor.java:210) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.RulesVisitor.leave(RulesVisitor.java:197) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:42) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:38) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:38) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:38) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:38) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.LanguageTraversal.traverse(LanguageTraversal.java:28) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.validation.Validator.validateDocument(Validator.java:42) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.validate(GraphQL.java:539) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.parseAndValidate(GraphQL.java:509) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.lambda$parseValidateAndExecute$3(GraphQL.java:490) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.execution.preparsed.NoOpPreparsedDocumentProvider.get(NoOpPreparsedDocumentProvider.java:11) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:486) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.executeAsync(GraphQL.java:470) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
	at graphql.GraphQL.execute(GraphQL.java:401) ~[graphql-java-2019-01-10T17-57-42-5caa4f29.jar:?]
--

To Reproduce
Please provide a code example or even better a test to reproduce the bug.

Activity

  1. tinnou
    added 2 commits that reference this issue on Mar 8, 2019

    Fix graphql-java#1440 ClassCastException when using a fragment with w…

    This issue will close once commit 7721f62 is merged into the 'master' branch.
    7721f62

    Fix graphql-java#1440 ClassCastException when using a fragment with w…

    This issue will close once commit a0b561d is merged into the 'master' branch.
    a0b561d
  2. andimarek
    added a commit that references this issue on Mar 11, 2019

    Merge pull request #1450 from tinnou/9.x-fix-classCastException-type-…

    This issue will close once commit cf1e838 is merged into the 'master' branch.
    cf1e838
  3. andimarek
    closed this as completedin 7721f62on Mar 11, 2019
  4. andimarek
    added a commit that references this issue on Mar 11, 2019

    Merge pull request #1449 from tinnou/fix-classCastException-type-cond…

    This issue will close once commit 03dc939 is merged into the 'master' branch.
    03dc939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.