Skip to content

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

@neongreen

Description

@neongreen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions