We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In a regular array field, you can use the value of other fields in the document as params to your request. E.g.,
{ name: 'tags', type: 'array', of: [ { type: 'reference', to: [{type: 'tag'}], weak: true, options: { filter: ({document}) => { return { filter: '$section == appliesTo._ref', params: { section: document.section?._ref, }, } }, }, }, ], },
Ideally, with this plugin and a query in the predefinedTags option, you would be able to grab the ({ document }) to use values as params. E.g.,
predefinedTags
({ document })
{ name: 'tags', type: 'tags', options: { predefinedTags: async ({document}) => await client.fetch(`*[_type == "tagRef" && $section == appliesTo._ref ]{label, value}`, { section: document.section._ref }) }, }, },
Is this possible?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In a regular array field, you can use the value of other fields in the document as params to your request. E.g.,
Ideally, with this plugin and a query in the
predefinedTags
option, you would be able to grab the({ document })
to use values as params. E.g.,Is this possible?
The text was updated successfully, but these errors were encountered: