apollographql / graphql-tag

A JavaScript template literal tag that parses GraphQL queries
MIT License
2.32k stars 176 forks source link

DocumentNode types dont match between graphql-tag 12.2.6 and graphql 16.6.0 for typescript projects #659

Closed steelerc69 closed 2 years ago

steelerc69 commented 2 years ago

Error message received during compile is:

Types of property 'kind' are incompatible.
  Type '"Document"' is not assignable to type 'Kind.DOCUMENT'.
steelerc69 commented 2 years ago

Seems to be a node resolution issue! not yours. sorry!

josehernandezv commented 2 years ago

How did you fix it @steelerc69 ? I'm having the same issue

smcgivern commented 9 months ago

In our case, we had a combination of factors:

  1. graphql-tag was in devDependencies.
  2. graphql was in dependencies.
  3. A library that had a dependency on a different version of graphql, along with a dependency on graphql-tag, was also in dependencies.
  4. We installed dependencies with pnpm install --prod --shamefully-hoist, which meant we got the peer versions in 3 above, not the version from 1.