Installing graphiql breaks graphql-codegen schema validation [closed]

Installing graphiql breaks graphql-codegen schema validation [closed]


-2

Which packages are impacted by your issue?
@graphql-codegen/cli

Describe the bug
Running yarn codegen after installing graphiql package throws syntax error:

Expected Name, found "}".

if graphiql package is removed, everything works fine.

Document.graphql file

query ExampleQuery {
  company {
    ceo
  }
  roadster {
    apoapsis_au
  }
}

codegen cli error

✔ Parse Configuration
❯ Generate outputs
✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to ./src/types/graphql.ts
    ✔ Load GraphQL schemas
    ✖ Syntax Error: Expected Name, found "}".
    ◼ Generate
error Command failed with exit code 1.

Here is a codesandox for the issue
codesandbox : link

Steps to Reproduce the Issue:

  1. Open terminal
  2. Run yarn codegen
  3. Now remove graphiql packages
  4. Run yarn codegen

I can’t figure out what is causing this. Probably some nested dependency issues? I need both of these packages as I need a playground for our customers to try our graphql endpoints.

**Code sandbox **: link might have to fork it to use the terminal

New contributor

SSP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

4

  • Welcome to Stack Overflow! Please DO NOT attach images of errors. They cannot be copy/pasted, indexed by search engines, and can be blocked by filters. Please read How to Ask and edit your question to add your error as formatted text. For more information, please see the Meta FAQ entry Why not upload images of code/errors when asking a question?, along with this website

    – Fastnlight

    2 hours ago

  • 1

    The URL shortener does not work for me. Could you change that to the real link? (Better yet, please also add the code into the question, so that it will still make sense if the links break).

    – halfer

    1 hour ago


  • 1

    @halfer codesandbox.io/p/sandbox/fragrant-bird-6n72vc might have to fork it to try the terminal. also, updated the issue

    – SSP

    1 hour ago


  • @Fastnlight removed and updated my issue

    – SSP

    1 hour ago


Load 5 more related questions


Show fewer related questions

0

Leave a Reply

Your email address will not be published. Required fields are marked *