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
Let's consider I have a collection of blog posts called posts. Then I will have access to a GraphQL command called allPosts. This works perfectly fine except when dealing with slugs generated by the text fields with option "slug": true. It is indeed possible to filter using slug but you can't return the slug value as an argument in the gql request.
This works perfectly fine. but if I add the title_slug to the variables I want returned, I get following message:
"Cannot query field \"title_slug\" on type \"posts\". Did you mean \"title\"?"
As a workaround I just reuse the same variable as I used to request the data with, but let's say you have assigned an author to the post, and need the slug of their name to link to all their posts e.g.
This won't be possible neither. But if I request the author details separately in a collections request i.e. { collection(name:"writers", filter: {_id: xxxxxxxxxxxxx}) } then I do indeed receive the slug value as part of the entire returned JSON object. I just wished I could return this as part of the nested request as above example.
The text was updated successfully, but these errors were encountered:
Let's consider I have a collection of blog posts called
posts
. Then I will have access to a GraphQL command calledallPosts
. This works perfectly fine except when dealing with slugs generated by the text fields with option"slug": true
. It is indeed possible to filter usingslug
but you can't return the slug value as an argument in the gql request.This works perfectly fine. but if I add the
title_slug
to the variables I want returned, I get following message:"Cannot query field \"title_slug\" on type \"posts\". Did you mean \"title\"?"
As a workaround I just reuse the same variable as I used to request the data with, but let's say you have assigned an author to the post, and need the slug of their name to link to all their posts e.g.
This won't be possible neither. But if I request the author details separately in a collections request i.e.
{ collection(name:"writers", filter: {_id: xxxxxxxxxxxxx}) }
then I do indeed receive the slug value as part of the entire returned JSON object. I just wished I could return this as part of the nested request as above example.The text was updated successfully, but these errors were encountered: