When using the Reference Type in Squidex, the API representation is like this:
{
"categories": [
"7722daf6-1ba7-4b2a-a5bb-fc57e22f5645",
"b666b172-9918-4764-ac26-300ba4857d5f"
]
}
Is there a way to retrieve the content of the reference too without doing an additional API call?
You can use the graphql endpoint for that.
What should be the graphql endpoint?
Edit: Ok I found it.
The X-Flatten header does not seem to have affect on the results returned from GraphQL. Is this intentional?
I hope I have it mentioned in the docs. It is intentional. For my understanding the idea of graphql is to express everything in the query. The X-Flatten header would be not very intuitive for graphql (and hard to realize).
Thanks for the clarification! However, I did not manage to find this statement in the documentation.
Thanks a million! Is it possible to add more GraphQL queries from the UI?
How do you mean it? I don’t get it
Is it possible to add more customized GraphQL queries ourselves on Squidex using the user interface?
The queries are generated from the schemas. How you use them is up to you. What are you looking for?
Sorry for the late reply. Yes the answer is clear now, because I thought you cann add more yourself.
Thank you for your constant support!
Since the X-Flatten header is not taken into account for GraphQL queries, how should we do the query to only get “en” values in the response?
The graphql syntax does not allow such modifications unfortunately, but in graphql you have to define the languages manually anyway. The fallback rules still apply. If you requesting english with
name {
de
}
and there is no english but Chinese is your fallback, you will get chinese for this field.
@Sebastian is there any way to get the content type without using graphql?
Maybe instead of
“categories”: [
“7722daf6-1ba7-4b2a-a5bb-fc57e22f5645”,
“b666b172-9918-4764-ac26-300ba4857d5f”
]
This?
“categories”: [
{
“id”: “7722daf6-1ba7-4b2a-a5bb-fc57e22f5645”,
“contentType”: “type1”
},
{
“id”: “b666b172-9918-4764-ac26-300ba4857d5f”,
“contentType”: “type1”
}
]
Cool thanks for the response