DocumentNode is unused
See original GitHub issueIn the generated output when using queries with Apollo Client 3, the DocumentNode
import is generated but unused.
import { DocumentNode } from 'graphql';
This is my codegen.yml
overwrite: true
schema:
- 'url'
documents: 'src/graphql/*.graphql'
generates:
./src/generated/typed-document-nodes.ts:
plugins:
- typescript
- typescript-operations
- typed-document-node
Will this import be used for other operations?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Refetching queries in Apollo Client - Apollo GraphQL Docs
Each element can be either a query's string name or a DocumentNode object. Analogous to the options.refetchQueries array for mutations. Pass "active" (or...
Read more >TypedDocumentNode: the next generation of GraphQL and ...
TypedDocumentNode is a great solution for having pre-compiled ( DocumentNode ) GraphQL operations with built-in support for TypeScript types.
Read more >passed to parser was not a valid GraphQL DocumentNode ...
You're calling the graphql function twice -- once in your definition of listMessages and createMessage and then again in your export ...
Read more >Typed Document Node - Episode #41 - graphql.wtf
A DocumentNode is a GraphQL operation AST that can be used interchangable with any GraphQL client that supports it.
Read more >DocumentNode in HtmlAgilityPack. Shouldn't SelectNodes ...
To access the page information, I used this code. The website has now changed, though, and my application now gives a null error.......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in: https://github.com/dotansimha/graphql-code-generator/pull/4462 Will be available with the next release of codegen 😃
@ryands17 yeah, see https://github.com/dotansimha/graphql-typed-document-node/issues/15 . in case variables object isn’t correct, it does a fallback to
any
and allow non-typed usage (happens because of the overloaded method). Also, this solution requires you to settypes
(and lose the auto-detection of types in TS compiler, you’ll have to specify all@types/...
packages manually).