GraphQL Codegen issue: Unable to load template plugin matching ‘typescript-common’

GraphQL Codegen issue: Unable to load template plugin matching ‘typescript-common’


-1

I am trying to setup GraphQL Code Generator. But I get this error:

gql-gen --config codegen.ts

✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to src/graphql/generated/schema.ts
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖
      Unable to load template plugin matching 'typescript-common'.
      Reason:
      Body must be a string. Received: undefined.
 ELIFECYCLE  Command failed with exit code 1.

My codegen config file:

// codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
  schema: [
    {
      'https://my-endpoint.com': {
        headers: {
          'Introspection-Key': '8787667676867686678432',
        },
      },
    },
  ],
  documents: ['src/components/**/*.gql'],
  generates: {
    'src/graphql/generated/schema.ts': {
      plugins: [
        'typescript-common',
        'typescript-client',
        'typescript-react-apollo',
      ],
    },
  },
};
export default config;

What could be the issue?


Load 5 more related questions


Show fewer related questions

0



Leave a Reply

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