You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Projects that are using Apollo Client 3.0 onwards should use exports from @apollo/client instead of @graphql-typed-document-node/core and graphql-tag respectively.
When we pass in --td flag when generating, it outputs:
Ideally, the CLI would be smart enough to detect if the project is using Apollo Client 3.x onwards (e.g, checking package.json for @apollo/client), and change the generated file to:
I've manually changed the imports to use @apollo/client without installing additional packages.
Alternative Solution
If this is too many cases to be covered (E.g, to cover not only Apollo but other library as well), we could instead provide examples and let users to create this file themselves.
Issue
Projects that are using Apollo Client 3.0 onwards should use exports from
@apollo/client
instead of@graphql-typed-document-node/core
andgraphql-tag
respectively.When we pass in
--td
flag when generating, it outputs:Proposal
Ideally, the CLI would be smart enough to detect if the project is using Apollo Client 3.x onwards (e.g, checking
package.json
for@apollo/client
), and change the generated file to:Current Solution
I've manually changed the imports to use
@apollo/client
without installing additional packages.Alternative Solution
If this is too many cases to be covered (E.g, to cover not only Apollo but other library as well), we could instead provide examples and let users to create this file themselves.
References:
Apollo 3.0.0: gql
Apollo 3.2.0: typedDocumentNode
The text was updated successfully, but these errors were encountered: