Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scottopherson opened this issue Oct 24, 2023 · 1 comment · Fixed by #805
Closed

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

scottopherson opened this issue Oct 24, 2023 · 1 comment · Fixed by #805

Comments

@scottopherson
Copy link
Contributor

scottopherson commented Oct 24, 2023

Which packages are impacted by your issue?

@graphql-codegen/typescript-react-apollo

It looks like many of the other packages have this same issue but I haven't confirmed each one.

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/typescript-react-apollo@3.3.7" has unmet peer dependency "graphql-tag@^2.0.0".

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

"peerDependencies": {
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
"graphql-tag": "^2.0.0"
},

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/typescript-react-apollo@3.3.7" 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
@saihaj
Copy link
Collaborator

saihaj commented Sep 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants