Open jeffwillette opened 6 years ago
@deltaskelta Great idea! But it's already there ^^ https://github.com/fabien0102/gatsby-starter/blob/master/package.json#L20 it's done by gql-gen, can you tell me if it respond to your need? I don't know if the apollo-cli is better (it was not existing when I made this starter ;) )
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.
It can be a good improvement! I really need to test by myself 👍
If you want to add this command to the starter and replace the actual gql-gen
with apollo-cli
, I will review/accept your PR with pleasure :wink:
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 https://github.com/gatsbyjs/gatsby/issues/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