Graphql-code-generator: [typescript-graphql-request] Missing Headers type import

Created on 7 Jan 2021  路  3Comments  路  Source: dotansimha/graphql-code-generator

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. My GraphQL schema:
type Foo {
  id: ID!
}

type Query {
  foo: Foo!
}
  1. My GraphQL operations:
query test {
  foo {
    id
  }
}
  1. My codegen.yml config file:
schema: ./schema.gql
documents: ./src/**/*.gql
overwrite: true
generates:
  ./src/index.ts:
    plugins:
      - typescript
      - typescript-operations
      - typescript-graphql-request
    config:
      rawRequest: false
      skipTypename: true
      namingConvention:
        transformUnderscore: true

Expected behavior
Generate TypeScript code without any errors.

Environment:

  • OS: Windows 10
  • @graphql-codegen/...:
{
    "@graphql-codegen/cli": "^1.20.0",
    "@graphql-codegen/introspection": "^1.18.1",
    "@graphql-codegen/typescript": "^1.20.0",
    "@graphql-codegen/typescript-operations": "^1.17.13",
    "@graphql-codegen/typescript-graphql-request": "^3.0.0",
    "graphql": "^15.4.0"
}
  • NodeJS: 14

Additional context

I think it is related to #4793 because it import Headers when rawRequest: true but not by default or rawRequest: false.

bug plugins waiting-for-release

Most helpful comment

@dotansimha The fix actually created another problem which I reported in #5459

All 3 comments

Fixed, and it will be available in the next release (very soon!)

Fixed in @graphql-codegen/[email protected].

@dotansimha The fix actually created another problem which I reported in #5459

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zenVentzi picture zenVentzi  路  3Comments

edorivai picture edorivai  路  3Comments

jackhkmatthews picture jackhkmatthews  路  3Comments

iamdanthedev picture iamdanthedev  路  3Comments

rogerg93 picture rogerg93  路  3Comments