Hi, testing out GraphQL in Appfarm. Based on GraphQL documentation, you can do the following to fetch data with string matching.
query companyByName{
company(name: "hei") {
name
}
}
However, as you can see from the first screen shot, this does not work. And the reason for that is because as you can see from the Company constructor in the GraphQL IDE for Appfarm, only sort, filter, skip and limit are fields in the constructor.
The question then is how I can access the actual fields of the Company object? As you can see from the screenshot below. If I access the type Company. I get the real fields. How can I access these in the query?
That solution is correct. The only way to query data using GraphQL is to apply a filter to to query. Filters have more power than the parameter-filtering you suggest, but they have a bit more syntax.
We want to fetch Product for ClientID eq “XYZ”. However, company_reference does not have a filter-attribute, so it is impossible to filter. How should we do it?
Hi Jeremy.jean, we will wait to get suitable response as we are trying to do it in a single query. Also, note that it is at three levels Product - Owner - Company. Thank you for your inputs.
Hi,
When looking at the documentation of GraphQL queries (on the right side in GraphiQL), you can only filter on object class of the first level, so as far as I understand it, it’s just not possible (or not yet) to do that in a single query. But maybe someone from Appfarm can confirm or give insights about this feature request?
It seems to be the case with AppFarm GraphQL implementation. But in general we should be able to define “resolver” to fetch any data. Let us wait for AppFarm response.
There is currently (and not in near-future) no possibilities for filtering sub-entities (such as in SQL where you may use exists in with some sub-query).
What is the use case, is it just for data exploration, og for using grapghQL as a way of integration? If the last one is the case, you may solve it using a Service Endpoint instead.
Hi @kristian, Use case is Integration and we want to send all related data via single query just like in case of SQL as you mentioned. Now that we have answer from you, we have already implemented multi query within Service Endpoint and that is got exposed to client for integration.