Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strongly typed GraphQL queries #13546

Closed
kripod opened this issue Apr 22, 2019 · 4 comments
Closed

Strongly typed GraphQL queries #13546

kripod opened this issue Apr 22, 2019 · 4 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: GraphQL Related to Gatsby's GraphQL layer

Comments

@kripod
Copy link
Contributor

kripod commented Apr 22, 2019

Summary

Currently, the only option available to check for invalid GraphQL queries is through eslint-plugin-graphql by using gatsby-plugin-extract-schema.

It would be nicer if static types could be generated with graphql-code-generator during builds (even in development), extending a pre-defined interface (inside node_modules) through a file inside the .cache folder with declaration merging instead of using any in the type definitions of query-related methods.

Motivation

Static typing is gaining traction amongst frontend developers. A previous issue (#2374) has a partial solution for typed GraphQL queries, but proper support has yet to be built into the core of Gatsby.

@orta
Copy link
Contributor

orta commented Apr 22, 2019

The under-the-hood relay-compiler should have enough knowledge to generate for them for you (similar to how we build React apps (query - types with Relay )

@gatsbot
Copy link

gatsbot bot commented May 13, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label May 13, 2019
@orta
Copy link
Contributor

orta commented May 13, 2019

Also, @damassi explored this idea in https://github.com/damassi/gatsby-plugin-emit-graphql-types/

It's a pretty simple concept - but would need to know what are the extra fragments that particular plugins are adding to queries to reflect the types accurately.

@lannonbr lannonbr added the topic: GraphQL Related to Gatsby's GraphQL layer label Aug 14, 2019
@LekoArts
Copy link
Contributor

I'll close this in favor of #18983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: GraphQL Related to Gatsby's GraphQL layer
Projects
None yet
Development

No branches or pull requests

4 participants