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

Error on __schema query with comments #80

Closed
ovidiubuligan opened this issue Jul 27, 2020 · 6 comments
Closed

Error on __schema query with comments #80

ovidiubuligan opened this issue Jul 27, 2020 · 6 comments
Labels
bug Something isn't working spec compliance The change is intended to solve the problem of inconsistency with the official GraphQL specification

Comments

@ovidiubuligan
Copy link

I am using the latest 3.0.0-preview-1631 so parser version is 5.1.2 . The following query gives an error :

{
  __schema {
    
    types {
      kind
      
    }
  }
  
# __schema{
#   types {
#     name
#   }
# }
}

The error is :

{
  "errors": [
    {
      "message": "GraphQL.ExecutionError: ParserContext has 1 not applied comments.\r\n ---> System.ApplicationException: ParserContext has 1 not applied comments.\r\n   at GraphQLParser.ParserContext.Dispose()\r\n   at GraphQLParser.Parser.Parse(ISource source)\r\n   at GraphQL.Execution.GraphQLDocumentBuilder.Build(String body) in C:\\projects\\graphql-dotnet\\src\\GraphQL\\Execution\\GraphQLDocumentBuilder.cs:line 20\r\n   at GraphQL.DocumentExecuter.ExecuteAsync(ExecutionOptions options) in C:\\projects\\graphql-dotnet\\src\\GraphQL\\Execution\\DocumentExecuter.cs:line 86\r\n   --- End of inner exception stack trace ---",
      "extensions": {
        "code": "APPLICATION",
        "codes": [
          "APPLICATION"
        ]
      }
    }
  ],
  "extensions": {
    "tracing": {
      "version": 1,
      "startTime": "2020-07-27T09:02:21.0125943Z",
      "endTime": "2020-07-27T09:02:21.0125943Z",
      "duration": 354200,
      "parsing": {
        "startOffset": 5200,
        "duration": 303400
      },
      "validation": {
        "startOffset": 0,
        "duration": 0
      },
      "execution": {
        "resolvers": []
      }
    }
  }
}
@sungam3r sungam3r transferred this issue from graphql-dotnet/graphql-dotnet Aug 15, 2020
@sungam3r sungam3r added the bug Something isn't working label Aug 15, 2020
@sungam3r
Copy link
Member

Relates to #33 and #69.

@sungam3r sungam3r added the spec compliance The change is intended to solve the problem of inconsistency with the official GraphQL specification label Aug 17, 2020
@rmeshksar
Copy link

Hi, Is there any update on the fix for this issue?

@sungam3r
Copy link
Member

Nope

@rmeshksar
Copy link

I thought the following issue has been fixed:
graphql-dotnet/graphql-dotnet#1415

It only happens if the comment does not describe any field or selection or block, like having comment after the query or before closing } oft he query.

@Shane32
Copy link
Member

Shane32 commented Jan 15, 2021

This also produces incorrect results:

query _ {
    person {
        name
        #comment1
    }
    #comment2
    test {
        alt
    }
}

What happens is that comment1 is incorrectly applied to alt.

@sungam3r
Copy link
Member

Fixed in #104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working spec compliance The change is intended to solve the problem of inconsistency with the official GraphQL specification
Projects
None yet
Development

No branches or pull requests

4 participants