Skip to content
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

fix: use resolver for lists #248

Merged
merged 3 commits into from
Jul 31, 2023
Merged

Conversation

ascorbic
Copy link
Contributor

PR #242 tried to improve efficiency of resolution by using Gatbsy's built-in @link directives rather than custom resolvers for all references. However it caused a regression (#245) in cases where there is a list type with a union that contains a mix of references and inline nodes. This isn't a pattern that can be represented in Gatsby by default, so the @link directive failed. Alongside this, lists of references don't have the @reference directive added in the Sanity schema, so there is no way to determine if they are inline or references. This meant we can't reliably add @link directives for these.

For thios reason, this PR adds back custom resolvers for lists.

I have tested this locally with many sorts of lists and it works well, but I would like to work out a way to add better tests to handle this.

Fixes #245

@vercel
Copy link

vercel bot commented Jul 26, 2023

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

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jul 31, 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 31, 2023 8:45am

Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

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

Thanks! ☺️

@stipsan stipsan merged commit e587dce into sanity-io:main Jul 31, 2023
9 checks passed
@frodestorhaug
Copy link

frodestorhaug commented Aug 2, 2023

When will there be a new package release with this fix ? thanks 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error building gatsby after updating to 7.7.0
3 participants