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

Can't run "Generate GQL codegen": Config ... package.json does not exist #29

Open
neongreen opened this issue Jan 20, 2023 · 0 comments

Comments

@neongreen
Copy link

I'm using extension v1.1.0.

My configs:

codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli'
import { printSchema } from 'graphql'
import { schema } from '@lib/graphql/schema'

const config: CodegenConfig = {
  schema: printSchema(schema),
  documents: ['{components,lib,pages}/**/!(*.graphql).{ts,tsx}'],
  generates: {
    './generated/graphql/': {
      preset: 'client',
      plugins: [],
    },
  },
}

export default config
graphql.config.json
{
  "schema": "http://localhost:3000/api/graphql"
}

When running "Generate GQL codegen", I'm getting:

image

Command 'Generate GQL codegen' resulted in an error (
Config /Users/artyom/code/windorg/woc/package.json does not exist.

$ graphql-codegen --config /Users/artyom/code/windorg/woc/package.json

Please make sure the --config points to a correct file.
)

The package.json file does exist, and running npx graphql-codegen works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant