graphql-spring-boot icon indicating copy to clipboard operation
graphql-spring-boot copied to clipboard

middleware.js:1 Uncaught GraphQLError: Syntax Error: Unexpected <EOF>.

Open mjoconnor1985 opened this issue 2 years ago • 1 comments

Describe the bug Input GraphQL types cause this error. As soon as I use an input for a Mutation I get the following error in the console, and the schema and documentation won't load.

middleware.js:1 Uncaught GraphQLError: Syntax Error: Unexpected <EOF>. at i (middleware.js:16) at e.t.unexpected (middleware.js:22) at e.t.parseValueLiteral (middleware.js:22) at d (middleware.js:22) at k (middleware.js:16) at middleware.js:16 at Array.reduce () at r (middleware.js:16) at S (middleware.js:16) at fields (middleware.js:16)

All my queries and mutations still work but I no longer get autocomplete or any schema documentation. The schema is an absolute must for client devs and QA so we can't do without it. I get the error whenever I use an input type for a mutation. If I use something basic like a String as the input for a mutation, I do not get this error. It does this will all inputs.

type Mutation { sendEmail(emailRequest: TestInput ): String }

input TestInput { firstName: String }

To Reproduce Steps to reproduce the behavior: See above description. I'm using version 11.1.0 of the GraphQL kickstarters, 2.5.2 for Spring Boot.

Expected behavior I expect to not get this error and the schema to generate properly.

Screenshots image

As you can see, the mutation works but it throws an error in JS and the schema can't load.

image The schema query that is being sent to the server completes successfully.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 92.0.4515.159 (Official Build) (64-bit)

Additional context Add any other context about the problem here.

mjoconnor1985 avatar Aug 26 '21 16:08 mjoconnor1985