Gatsby: How to extend dynamically generated fields in graphql schema?

Created on 27 Jan 2018  Â·  2Comments  Â·  Source: gatsbyjs/gatsby

Description

What is the best way to extend GraphQL Schema for markdownRemark frontmatter and site siteMetadata?

Gatsby adds fields to schema automatically, based on the data source. But in our case fields may be or may not be in data. And we use those fields in graphql queries.

Currently I use some workaround like This:
c1f3d07b-9284-44b9-817a-b3106096b035
35db7a0e-7e04-4c99-a7e2-bd365e21492f

Environment

Gatsby version: latest

Actual result

Gatsby failed because of field of query is not in schema

Expected behavior

Fields are added via gatsby api even if thay are absent in data

...

question or discussion

All 2 comments

Hi, this is unfortunately known issue that I'm working to resolve - you can check discussion here - https://github.com/gatsbyjs/gatsby/issues/3344

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kalinchernev picture kalinchernev  Â·  3Comments

magicly picture magicly  Â·  3Comments

andykais picture andykais  Â·  3Comments

KyleAMathews picture KyleAMathews  Â·  3Comments

totsteps picture totsteps  Â·  3Comments