-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Suggest, use standard apollo graphql react composing to enable chaning of graphql data fetching. #1893
Comments
Hmmm we provide automated/manual ways of linking data within the schema. E.g. your scenario above is already very doable in Gatsby. Can definitely see how programmatic linking would be simpler for prototyping, etc. where you just want to quickly get something working. |
Aha, so one have to setup the link in the graphql schema. Is there an example or piece of code I can look at to try that out? I've seen that one can extend the schema, but only on the root level, is that what you are suggesting? I was just thinking that if this supported the default graphql usage in react, it would be much easier to pick up and go for us that already have some experience in using apollo in react. And also this means that you could just link to their documentation instead of creating your own for this particular type of usage. |
Apollo is runtime where we run at build time so not really possible to do same things as them necessarily. That being said, this pattern is really interesting and could be supported i.e. we allow running code for graphql queries. |
What is that other method you mentioned "automated/manual ways of linking data within the schema"? This is basically what I want to do:
And then use that image in the template for the blog post. This also feels related: |
God dammit, it was easier to do than I though! I was just looking in the wrong place: One just have to pass down data in the context of the page query, I'll close this because one just have to understand the createPage api. This is how I solved it:
And in the template:
|
Hi again, still love this project!
Here's an idea, why not use the same composability that we see all over apollo stack documentation for react? like this:
This would allow for chaning of request and using variables that are added to markdown frontmatter like the example above.
And this would also allow for adding queries to components, such as meny component or other global or partly global stuff that needs data to be rendered.
The text was updated successfully, but these errors were encountered: