graphql-code-generator-community icon indicating copy to clipboard operation
graphql-code-generator-community copied to clipboard

[typescript-react-apollo] `graphql-tag` peer dependency is missing

Open scottopherson opened this issue 2 years ago • 0 comments

Which packages are impacted by your issue?

@graphql-codegen/typescript-react-apollo

Describe the bug

When following the typescript-react-apollo install instructions at:

https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-apollo#installation

yarn add --dev @graphql-codegen/typescript-react-apollo

I receive a warning:

warning " > @graphql-codegen/[email protected]" has unmet peer dependency "graphql-tag@^2.0.0".

Looking at the package.json, graphql-tag is indeed defined in peerDependencies:

https://github.com/dotansimha/graphql-code-generator-community/blob/d334e8045f30b7995d22deb69a01237018396214/packages/plugins/typescript/react-apollo/package.json#L39-L42

But graphql-tag is not imported in any of the three src/ directory files:

https://github.com/dotansimha/graphql-code-generator-community/tree/d334e8045f30b7995d22deb69a01237018396214/packages/plugins/typescript/react-apollo/src

graphql-tag is only imported once in the tests/ directory:

https://github.com/dotansimha/graphql-code-generator-community/tree/d334e8045f30b7995d22deb69a01237018396214/packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts#L2

Should graphql-tag instead be defined in devDependencies? 🤔

Steps to Reproduce the Bug or Issue

  1. Install the plugin.
yarn add --dev @graphql-codegen/typescript-react-apollo
  1. See warning message.
warning " > @graphql-codegen/[email protected]" has unmet peer dependency "graphql-tag@^2.0.0".

Expected behavior

  • See plugin installed without any warning messages.

And if graphql-tag is indeed required:

  • See documentation that graphql-tag is required to be installed.

Platform

  • OS: macOS
  • NodeJS: 20.8.1
  • graphql version: 15.8.0
  • @graphql-codegen/cli version: 3.2.2
  • @graphql-codegen/typescript version: 3.0.2
  • @graphql-codegen/typescript-document-nodes version: 2.3.12
  • @graphql-codegen/typescript-operations version: 3.0.2
  • @graphql-codegen/typescript-react-apollo version: 3.3.7

scottopherson avatar Oct 24 '23 01:10 scottopherson