Using the Reference Type

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.

I added it to the docs.

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”
}
]

Simple answer: No

And of course you can make another call to get all references by their ids. Check out this test: https://github.com/Squidex/squidex-samples/blob/master/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ClientQueryTests.cs#L32

Cool thanks for the response