[docs] Gatsby Internals docs should be updated (schema customization, Incremental Builds, v3) #31211
Replies: 12 comments
-
I'm interested in taking this one but was wondering if you could point me at a PR that fixes a similar issue for my reference. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@k-conway This is great - and sorry for the very late reply! Our schema generation code changed quite dramatically in version 2.2, so big chunks of that would have to be rewritten. I cannot point to an example PR, but my understanding is that the "Behind the scenes"/"Gatsby internals" docs should be like a narrated code walk-through. The entry point in the schema build step is here, and a good overview of the steps involved are here and here.
Don't hesitate to ask if anything is unclear! |
Beta Was this translation helpful? Give feedback.
-
Would be great to cover how to create directives for non-fields (createFieldExtension only covers FIELD_DEFINITIONS). |
Beta Was this translation helpful? Give feedback.
-
@tbrannam what's the usecase for custom type extensions? |
Beta Was this translation helpful? Give feedback.
-
I may have the name of what I'm looking for wrong. In this particular use case I am working to add additional metadata which would be processed by an Apollo-Link (by modifying the graphql context for the query) The implementation of the link would modify some headers which are required to modify some HTTP headers for a few specific Graphql queries (Localization related). Originally I thought that I could somehow reach into the the gatsby-source-graphql config and somehow cause the fetch implementation to read some dynamic value - but the async nature of the these made it a synchronization issue. In apollo-client hooks (useQuery) I think that you could add additional properties to the context at the call site - which doesn't appear to be possible with a raw
Generally one could set the custom headers in the source config, but there are a couple of edge cases where the header needs to be modified. |
Beta Was this translation helpful? Give feedback.
-
@tbrannam thanks for the writeup! interestingly, there has been another request today for custom type extensions, should we move the discussion there to discuss how an api for a |
Beta Was this translation helpful? Give feedback.
-
@stefanprobst is this still an open issue? If so, I came across this issue when reading the documentation on |
Beta Was this translation helpful? Give feedback.
-
Hi @alliestehney, yep it's still open! There is also #18280 which needs some attention. We would welcome any contributions on this! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For anyone like me who is looking at this now and wants to see the code @stefanprobst's was referencing in his comment, here are links to the schema files as they existed at the time of the comment:
|
Beta Was this translation helpful? Give feedback.
-
My thread add #30070 is a duplicate of this, here's some more: Request for examples of extensionsSome recommended topics to cover from Actions page#
Consider using
|
Beta Was this translation helpful? Give feedback.
-
Refresh documentation of
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The "Gatsby Internals" ("Behind the scenes") docs for schema generation are out of date as they still refer to the pre-Schema Customization codebase.
Beta Was this translation helpful? Give feedback.
All reactions