-
Notifications
You must be signed in to change notification settings - Fork 114
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
Source related resource content from Swiftype #594
Conversation
…rent to the child
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 is so much work woaaah it looks all good to me 👍 :)
resolve: 'gatsby-source-swiftype', | ||
options: { | ||
file: `${__dirname}/src/data/related-pages.json`, | ||
refetch: Boolean(process.env.BUILD_RELATED_CONTENT), |
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.
Is this for caching reasons?
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.
Yes. By default, the data is resolved from the src/data/related-pages.json
file. When we need to refresh that data and make new requests to Swiftype, setting the BUILD_RELATED_CONTENT
environment variable will instruct the plugin to go make new requests to Swiftype and save them in the JSON file.
🎉 This PR is included in version 1.11.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #584
Closes #589
Description
Adds the ability to source data from Swiftype to populate the related resource content. This adds the GraphQL nodes needed to fetch from the site as well as the flags to tell it whether to regenerate results from Swiftype or read from the local JSON file. This also ensures results from the frontmatter defined resources are filtered out from the search call.