Open williamneves opened 9 months ago
I have this follow schema:
{ name: "program", title: "Programa", description: "Etapas do programa", type: "array", of: [{ type: "object", fields: [{ name: "step", title: "Etapa", type: "string", }, { name: "etd", title: "Tempo Estimado de duração", type: "number", initialValue: 5, }, { name: "colaborador", title: "Colaborador", type: "reference", to: [{ type: "colaborador" }], }, ], }, ], },
and my problem is, I cant fetch with the colaborador reference, the query I have so far is:
colaborador
q("*") .filter("_type == 'devocional'") .grab$({ title: q.string(), musicas: q('musicas') .filter() .deref() .grab$({ title: q.string() }), program: q.array(q.object({ step: q.string(), eta: q.string(), colaborador: q('colaborador', {isArray: false}). filter() .grab$({ name: q.string() }) })) }),
And this is not fetching, and this the query generated:
*[_type == 'devocional']{title, "musicas": musicas[]->{title}, program}
And this is a response:
title: "Visita a uma prisão" musicas: [...] 4 items 0: {...} 1 properties title: "A Alegria" 1: {...} 1 properties title: "Quão bom e Quão maravilhoso" 2: {...} 1 properties title: "Ninguém explicada Deus" 3: {...} 1 properties title: "Entra na minha casa" program: [...] 6 items 0: {...} 3 properties etd: 5 step: "Orção inicial - Convidar um colcaborador" _key: "c94a88d3d7c8" 1: {...} 3 properties step: "momento musical com Todos" _key: "bd231ce27d9c" etd: 10 2: {...} 3 properties _key: "c5e179d96e2a702826a76f1cc05dbcf4" etd: 10 step: "Participação Especial/ Dueto"``` No colaborador at the response. Thanks!
You're probably after deref()
Is there an existing issue for this?
Code of Conduct
Question
I have this follow schema:
and my problem is, I cant fetch with the
colaborador
reference, the query I have so far is:And this is not fetching, and this the query generated:
*[_type == 'devocional']{title, "musicas": musicas[]->{title}, program}
And this is a response: