-
Notifications
You must be signed in to change notification settings - Fork 60
feat: support shared content #269
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
Conversation
…build time. This also avoid collisions with other sanity source plugins
…le to: types. Re-mock schema for testing
…multiple target types
- feat: added support for passing apiHost option to gatsby config
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
Cherry picked the approved PR #259 into here |
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.
🚀 🚀 🚀
@SocketSecurity ignore styled-components@5.3.11 |
This PR introduces a pre-processing step scanning the gql schemas from Sanity for directives that indicate a field or type as a cross dataset reference. When these directives are found, the corresponding fields are manipulated to be treated as normal references with the expectation that the user will add another source config for the target dataset in the Gatsby app configuration. Through Gatsby schema composition the types should then match up, and the node resolution should also pick out the target documents.
The main implementation to review is found in
packages/gatsby-source-sanity/src/util/mapCrossDatasetReferences.ts
End to end tests de-referencing both normal and cross dataset references from actual Sanity datasets are included in the
cdrs
Gatsby app inexamples
.To run tests, first make sure the test app is running
Then run the test suite in that folder