Description
I am in the process of writing a blog using the example blog template, one feature I want to add is the ability to list of contributors to a blog post! However this introduces some problems.
Currently the two options: gatsby-source-github and @mosch/gatsby-source-github.
gatsby-source-github is awesome because it utilises the real (to the best of my understanding) GraphQL v4 GraphQL API! Unfortunately the query can also only be ran inside of the plugins setup folder. However I need to run it on each page's source filename which I don't know ahead of time (I can hard code, but dynamic ftw)
@mosch/gatsby-source-github however has the ability to select the files I want to query! However it's both limmited by the fact that the queries are not the standard Github v4 GraphQL endpoints + it also queries all the data at instantiation point of the plugin.
What would be ideal would be the ability to query the GraphQL v4 API during the process of building each individual page/blog post. Basically is there a way I can extend the graphql schema via Schema Stiching and run those queries inside of the createPage loop?
It looks like you mention schema stiching here: #2423 now re-fetching data is also pretty nifty, however all I need is the ability to at compile time fetch the data I need for each file that I'm building the page from.
I am pretty sure that I can achieve what I want through the current system, all I would need to do is take gatsby-source-github and reverse engineer it to run my file history graphQL query for each blog post file.
But what would be really awesome is if I could just extend the GraphQL schema that is exposed to me via createPage (I assume createPage looks for pageQuery being exported from my blog post component) through schema stiching WITHOUT having to pre-fetch all the data via the plugin, if instead I could query the data with variables passsed in on a page by page basis.
I'm really burning the midnight oil here like crazy and I can barely read what I'm writing here, but I needed to dump this whilest it was all in my head. If this doesn't make sense please let me know and I'll re-write it. Sorry in advance if this is too hard to understand.