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
I am just getting started with converting my gatsby site to typescript and it looks like apollo-cli can generate all the interfaces for the page queries so you don't have to type out the interfaces yourself.
I had success with the following commands
apollo schema:download --endpoint https://localhost:8000/___graphql gatsby-schema.json
apollo codegen:generate --tagName=graphql --queries=./src/pages/**/* --schema=./gatsby-schema.json gatsby-queries.d.ts
The text was updated successfully, but these errors were encountered:
I believe the only difference in apollo is that is actually parses the graphql tags in your files so you get interfaces for your component queries and not just the whole API. This way you wouldn't have to assemble an interface to match the query in every component file.
I'd be happy to add it, but it seems there is a current problem with typescript in gatsby that is affecting this. I'll have to wait until I can find a way around that and then I'll add the commands. Here is the issue gatsbyjs/gatsby#5789
I am just getting started with converting my gatsby site to typescript and it looks like
apollo-cli
can generate all the interfaces for the page queries so you don't have to type out the interfaces yourself.I had success with the following commands
The text was updated successfully, but these errors were encountered: