Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
chore(gatsby-source-graphql): docs on how to use apollo links #28686
chore(gatsby-source-graphql): docs on how to use apollo links #28686
Changes from 2 commits
6428994
47a48dc
7c8822a
da4d920
5540132
47934f0
5af7320
d003a98
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This intro paragraph could use a bit more context, to help people figure out whether or not this option is something they need.
Possible structure: (Feel free to correct the wording, since I don't totally know how this plugin works)
(You might not actually need the headings, I just added them to highlight the different chunks of information)
Introduction
[Sentence describing the problem (e.g., "Sometimes network requests fail, but that doesn't mean you want your query to fail.")] You can use the plugin's
createLink
option to add an Apollo Link to your GraphQL operation.(For more explanation of how Apollo Links work, check out this Medium article: Productionalizing Apollo Links.)
Types of Links
You can create different types of links, depending on the functionality you're trying to achieve:
apollo-link-retry
for retrying requests that time out// goal of the list above is to point them toward the right lib if they're trying to do this for the first time
Parameters
To use the
createLink
option in yourgatsby-config.js
, pass it [explanation of the parameters].Example
Here's an example of using the HTTP link with retries (using apollo-link-retry):
[code snippet]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is so much better 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add something about what the parameters are for the
createLink
option?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment in the example. We also have some examples of this option at the beginning of the readme.