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

Regression in "reference" field. Can't select information form reference inside "preview->select , preview -> prepare" #8441

Open
Unruly-Coder opened this issue Jan 28, 2025 · 0 comments

Comments

@Unruly-Coder
Copy link

Unruly-Coder commented Jan 28, 2025

Describe the bug
I have copied the component "internalLink" from the official sanity demo:

https://github.com/sanity-io/demo-ecommerce/blob/main/packages/sanity/src/schema/objects/linkInternal.ts

The newest version of sanity returns null for reference and undefined for rest properties related to reference

preview: {
    select: {
      reference: 'reference',
      referenceProductTitle: 'reference.store.title',
      referenceProductPriceRange: 'reference.store.priceRange',
      referenceTitle: 'reference.title',
      referenceType: 'reference._type',
      title: 'title',
    },
    prepare(selection) {
      const {
        reference, //null
        referenceProductPriceRange, //undefined
        referenceProductTitle,  //undefined
        referenceTitle,  //undefined
        referenceType,  //undefined
        title,
      } = selection
//...
   }
}

however when we remove all reference bindings and leave just reference, then we get simple reference object.

To Reproduce

Steps to reproduce the behavior:

  1. Copy internalLink,
  2. Mockup referenced document

Expected behavior

references should be rosolved

Screenshots

Which versions of Sanity are you using?

v: 3.72.1

What operating system are you using?

MacOS 15.0

Which versions of Node.js / npm are you running?

10.2.4
v20.11.0

Additional context
This may be important
next: 15.1.6,
React 19.0.0

Security issue?

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

No branches or pull requests

1 participant