Skip to main content
Schlumberger
Jun 29, 2023 10:10 AM UTC
Solved

FDM Graphql - Edges - Limitation over the number of edges fetched (only 50) when it is as a nested property

Hello,

We are trying to fetch the edges of an view in a graphql.

But graphql is returning only 50 edges at max. We see the cursor option in graphql, but it seems that it has been not implemented and is giving null even if there exists more data.

So question is - 

  1. When the cursor functionality for edges will be avaialble in graphql or some know issue as of now ?
  2. If this is a limitation how do we get edges data joined with the view data where the edge is present using the rest endpoints. Any best combination suggested as there will be multiple stages to resolve the cursor and the edges data, as we understand it.

Request your quick ideas on this how it could be achieved.

Practitioner ⭐️⭐️⭐️
Jun 30, 2023 11:35 AM UTC

You can pass a limit to the nested query like this

{
listMovie {
items {
actors(first: 1000) {
items {
externalId
}
}
}
}
}

if you want to paginate on a nested level, you need to use a `get...ById` query instead of the list query. As of now we only support pagination on the first level in list queries, and on the second level in getById queries.

13 replies

Practitioner ⭐️⭐️⭐️
Jul 27, 2023 5:47 AM UTC

If you want the data in a connected structure, you’d have to use graphql

Schlumberger
Jul 27, 2023 12:02 PM UTC

Back to square one, we cannot iterate over internal elements or structure using graphql.

So I think we can say that there is no way to get the connected data anyhow from cognite system. Consumer needs to do it on its own by using the query endpoint or some other way.
 

 

PS - I am not sure how this got marked as solved, may be I marked it accidently and no option to reopen.

Practitioner ⭐️⭐️⭐️
Jul 31, 2023 8:58 AM UTC

Ok so the query endpoint is off the table here if a requirement is to get a connected structure back.

Let’s try to figure out what you would require for the graphql to work. So currently with the `getById` graphql queries you can paginate through children. The problem here is that you don’t want to make multiple requests for multiple parent ids right?
 

With the `list` queries, we don’t support pagination of children, but you can get up to 1000 children. The problem here is that 1000 is not enough right?

If my above statements are true, can we talk about the use case more? Is this query for displaying data in a UI?