Using the Reference Type


#1

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?


#2

You can use the graphql endpoint for that.


#4

What should be the graphql endpoint?
Edit: Ok I found it.


#5

The X-Flatten header does not seem to have affect on the results returned from GraphQL. Is this intentional?


#6

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).


#7

Thanks for the clarification! However, I did not manage to find this statement in the documentation.


#8

I added it to the docs.


#9

Thanks a million! Is it possible to add more GraphQL queries from the UI?


#10

How do you mean it? I don’t get it


#11

Is it possible to add more customized GraphQL queries ourselves on Squidex using the user interface?


#13

The queries are generated from the schemas. How you use them is up to you. What are you looking for?


#14

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!


#15

#16

#17

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?


#18

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.