You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of how the S.documentList() resolves the type of children (which is completely unique and difficult to replicate for custom lists, but that's another story), it does not work with content releases.
Given the following structure:
S.listItem().title('Tester').child(S.documentList().apiVersion('2025-02-19').title('Test').filter(`...some filter that finds multiple types...`)),
If you create a new document in a release and try to open it from this list it will fail with the following error:
The problem is that the the createDocumentChildResolverForItem calls resolveTypeForDocument which only looks for a draft or published document, not documents in the current perspective. Therefore it does not find the document and therefore does not find the type and the above error is shown.
Which versions of Sanity are you using?
This is on version 3.77
The text was updated successfully, but these errors were encountered:
This might be besides the point, but as mentioned above this entire method seems a bit of a hack. It's weird that the child resolver isn't told what the type should be, when documentList knows what the type is, since it has a list of documents with both _id and _type. The intent for opening also contains the schemaType. So it seems very natural to pass down the type argument to the child resolver.
Another solution is to pass down the current perspective as part of the child resolver context. But that still requires it to figure out the type of something given the _id.
Because of how the
S.documentList()
resolves the type of children (which is completely unique and difficult to replicate for custom lists, but that's another story), it does not work with content releases.Given the following structure:
If you create a new document in a release and try to open it from this list it will fail with the following error:
The problem is that the the createDocumentChildResolverForItem calls resolveTypeForDocument which only looks for a draft or published document, not documents in the current perspective. Therefore it does not find the document and therefore does not find the type and the above error is shown.
Which versions of Sanity are you using?
This is on version 3.77
The text was updated successfully, but these errors were encountered: