Not generating types for queries
See original GitHub issueHi, I’m trying to generate types for my queries using this command (tried some other variations as well), But its only generating types based on my schema and not the queries I make in my react components (output here)
I expect to also see some types matching the allPeople
query inside allPeople.graphql
. What am I doing wrong? Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Generate GraphQL Types with Apollo Codegen Tutorial
In this post, you'll learn how to use Apollo's GraphQL codegen to generate TypeScript types for GraphQL operations in your Apollo Client ...
Read more >Why apollo client:codegen is not generate types?
You need to include the --includes option to indicate which files contain the actual queries for which to generate the types. From the...
Read more >How to Generate Typescript Types for GraphQL in React Project
In this article, I am going to tell you what is graphql-codegen, and how to use graphql-codegen to generate typescript types and react...
Read more >Advanced type safety (Reference) - Prisma
Prisma Client provides full type safety for queries, even for partial queries or included relations. This page explains how to leverage the generated...
Read more >How to use GraphQL Code Generator with React and Apollo
Ideally, this type-safe chain should not stop at the GraphQL API. ... Run npm run codegen to generate types and hooks for queries, ......
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
This “It seems like you provided a GraphQL schema instead of GraphQL document” warning happened to me too, when I upgraded graphql package version from 0.12.3 to 0.13.0
@JohannesHoppe try to wrap your glob selector with “…”, your command should be something like that:
(and your probably need to escape it if you are putting it inside
package.json
). It happens because your file system resolves the*
beforeglob
gets it, and it does not support features like**
(for recursive lookup)