Graphql-code-generator: v1.12.0: TypeError: Cannot read property 'location' of null

Created on 28 Jan 2020  路  5Comments  路  Source: dotansimha/graphql-code-generator

Describe the bug
running "graphql-codegen" now gives the error

TypeError: Cannot read property 'location' of null
        at /Users/<me>/Documents/Apps/<project>/node_modules/@graphql-toolkit/core/index.cjs.js:622:90

To Reproduce

upgrading to 1.12.0

  1. My codegen.yml config file:
schema: http://localhost:5000/graphql
documents: ./src/**/*.{ts,tsx}
overwrite: true
generates:
  ./src/graphql/types.tsx:
    config:
      withHooks: true
      withComponent: false
      withHOC: false
      withMutationFn: false
      addDocBlocks: false
    plugins:
      - typescript
      - typescript-operations
      - typescript-react-apollo

Expected behavior
generates types without failing

Environment:

  • OS: MacOS
  • @graphql-codegen/1.12.0:
  • NodeJS:

I changed nothing in my codebase but upgrading now creates this error

bug core waiting-for-release

Most helpful comment

Oops my bad - tabbed to the close and comment button by accident ;) Thanks for the fix

All 5 comments

Could you try with the canary version?
1.12.1-alpha-ca51a54f.1+ca51a54f

@ardatan working!

Let's keep it open until we release a patch version :)

Oops my bad - tabbed to the close and comment button by accident ;) Thanks for the fix

Fixed in v1.12.1 :)
Thanks @ardatan

Was this page helpful?
0 / 5 - 0 ratings