Skip to main content
Schlumberger
June 29, 2023
Solved

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

  • June 29, 2023
  • 13 replies
  • 340 views

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.

Best answer by mattmurph9

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 ⭐️⭐️⭐️
July 27, 2023

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

Schlumberger
July 27, 2023

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 ⭐️⭐️⭐️
July 31, 2023

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?