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

Stricter GraphQL typing using gatsby-plugin-typegen #1102

Merged
merged 3 commits into from
Sep 21, 2021

Conversation

cometkim
Copy link
Contributor

@cometkim cometkim commented Sep 1, 2021

Description

Hi 👋

Glad to see that the GraphQL homepage is built with Gatsby.

I set up the gatsby-plugin-typegen, which is the integration of GCG and Gatsby

All named queries are typed while gatsby develop running

Further steps

To unlock the power of GraphQL, I explored best practices while developing and using this plugin, and here are my two cents.

Nullability for implicitly inferred fields is normal. To get rid of it, we can define our model via schema customization API in gatsby-node and inject pre-transformed data.

The build-time data layer is a blessing for both development and runtime.

Colocating data dependencies using fragments is even better. just like Relay does

@Urigo Urigo merged commit d0eaeea into graphql:source Sep 21, 2021
@Urigo
Copy link
Contributor

Urigo commented Sep 21, 2021

Thank you @cometkim ! what a great tool
looking forward for your next PRs!

@cometkim cometkim deleted the typegen branch September 21, 2021 21:34
@cometkim cometkim mentioned this pull request Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants