Skip to content

Conversation

@ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jul 6, 2023

This PR adds support for setting a custom type prefix, which allows multiple instances of the plugin to be used. The prefix is in addition to the Sanity prefix, so for example if you have a movies type, setting the type prefix to Staging will make the type StagingSanityMovies.

@vercel
Copy link

vercel bot commented Jul 6, 2023

@ascorbic is attempting to deploy a commit to the Sanity Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@snorrees snorrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Thank you 🎉


export function getCacheKey(config: PluginConfig, suffix: CACHE_KEYS) {
return `${config.projectId}-${config.dataset}-${suffix}`
return `${config.projectId}-${config.dataset}-${config.typePrefix ?? ''}-${suffix}`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get a double -- here when config.typePrefix is undefined. Since its only a key, I guess it doesnt matter and is rather preferable to a more messy string template.

@vercel
Copy link

vercel bot commented Jul 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gatsby-source-sanity ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2023 11:10am

@github-actions
Copy link
Contributor

🎉 This PR is included in version 7.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants