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

Implement Type Definitions to handle "optional" fields #3

Open
jamesvidler opened this issue Feb 28, 2020 · 0 comments
Open

Implement Type Definitions to handle "optional" fields #3

jamesvidler opened this issue Feb 28, 2020 · 0 comments

Comments

@jamesvidler
Copy link
Contributor

You want to optionally use your field "postAuthor" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "agilityPostAgilityFields":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

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

No branches or pull requests

1 participant