graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

Syntax error when installing graphiql package

Open sanalpanicker opened this issue 2 years ago • 2 comments

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.

Screenshot 2023-11-09 at 2 27 07 PM

codegen.ts file

Screenshot 2023-11-09 at 2 29 10 PM

I can't figure out what is causing this. Probably some nested dependency issues?

Your Example Website or App

codesandbox : here might have to fork it to try the terminal

Steps to Reproduce the Bug or Issue

open terminal Run yarn codegen

Expected behavior

I expect it to throw no issues

Screenshots or Videos

No response

Platform

  • OS: masOS
  • NodeJS: 20
  • graphql version: 16.8.1
  • @graphql-codegen/* version(s): 5.0.0

Codegen Config File

const config: CodegenConfig = { schema: { '': { headers: { authorization: token ? Bearer ${token} : '', }, }, }, documents: '**/*.graphql', config: { skipDocumentsValidation: true, }, generates: { './src/types/graphql.ts': { plugins: ['typescript', 'typescript-operations', 'typed-document-node'], config: { documentMode: 'documentNode', }, }, }, };

Additional context

No response

sanalpanicker avatar Nov 09 '23 22:11 sanalpanicker

I think the link to the reproduction doesn't work, can you fix it?

Urigo avatar Nov 19 '23 14:11 Urigo

I think the link to the reproduction doesn't work, can you fix it?

@Urigo can you try this https://codesandbox.io/p/devbox/fragrant-bird-6n72vc

sanalpanicker avatar Feb 06 '24 23:02 sanalpanicker