I have a few questions about Squidex filter on GraphQL request.
From the doc in /api/graphql, It seem like Squidex is using OData filter on top of GraphQL. Is Squidex also support normal GraphQL query ? If it supported, Could I ask for the example queries please ? I tried by myself and it’s not working.
Does Squidex GraphQL support $expand param ? I want to filter the content from the ref object. eg. get users from company “ABC”.
How to exclude the content with empty ref object ? eg. get users with any companies except users without selected company. I tried some methods like “ne null” and “/$count gt 0” but it didn’t work.
How to filter the text with wildcard ? eg. input “Alb” and then it returns users with “Alb” in their name.
GraphQL uses OData as filter system. The reason is that I did not want to write a custom (or second) query system. You can find examples here: https://docs.squidex.io/guides/02-api#usdfilter. What is a normal GraphQL query?
No, it does not make sense with GraphQL I think. Do you have a reference from users to company? If yes you have to take the company id and use a simple eq filter `$filter=company eq ‘123…’``
Good question. Have to try it myself.
See the link in first answer. contains is your friend.
I got the error “Error trying to resolve queryUsersContents.”. I also went to the logfile for more information about the error but didn’t find anything logged.
Just a follow-up on the first item on the OP’s question- In other headless CMSes (I’ve looked at GraphCMS and Strapi) the queries would look something like
Are there plans to implement this style of queries?
It would also be great if “iv” does not need to be specified on each field in the filter string. In cases where there are multiple languages, a single “iv” would probably suffice? I assume consumers would normally need the values in only 1 language when querying. What I mean is something like
I have already thought about this problem and implemented an abstraction over the query system so that I can also implement other syntaxes. With the current implementation it is difficult to have a shortcut for iv, you have either to flatten all fields and specify a language or write another query language.
I also need to do exact same thing as Kasidit_Khamfoo filter query in graphql.
Is there any alternative way to filter the reference data fields?
eg:
{ queryArticlesContents(filter: “data/categories/iv/data/slug/iv eq ‘entertainment’”) { data { …} } }