Skip to main content
Gathering Interest

Expand GraphQL Query Size Limits to Support Scalable Application Development

Related products:Data Modeling
  • June 6, 2025
  • 1 reply
  • 71 views

Andrew Montgomery
Practitioner
Forum|alt.badge.img+1

Submitting on behalf of KAES

 

Request Summary

An increase in the query size limit for the GraphQL API in Cognite Data Fusion (CDF). The current query size restriction creates friction for our internal application development teams who need to retrieve moderate to large volumes of structured operational data in a single call.

Business Need

Our application developers are building lightweight, data-rich internal tools for frontline operations teams.

These applications are designed to pull:

  • Time series samples across multiple sensors for a given production line
  • Associated events, alarms, or trips within a time window
  • Work orders or files linked to that asset via relationships
  • Aggregated or contextual metadata for assets

However, due to current GraphQL query complexity or response size limitations, we are often forced to:

  • Paginate aggressively (which requires maintaining state client-side)
  • Perform multiple sequential queries (increasing latency)
  • Fall back to using the Python SDK, which adds infrastructure complexity and is not viable for modern frontend applications

Example Limitations Encountered

  • Querying data for 10 sensors over 24 hours requires multiple GraphQL calls or switching to the SDK
  • Fetching a list of assets and their most recent alarms or events cannot be done in one query
  • Attempting to pull OEE metrics and supporting raw data exceeds query limits if not broken up

While we understand pagination is supported, in many real-time or event-driven application contexts, pagination introduces unnecessary overhead and user complexity.

Workaround Limitations

Option Limitation
Python SDK Not feasible for frontend/web apps; adds middleware and cost
Pagination Adds client-side logic and complexity, especially for low-latency UIs
Query splitting Requires extra logic, multiple API calls, and longer response times

 

Requested Capabilities

We are requesting the following improvements:

  1. Expand max query depth/complexity or size threshold for the GraphQL API
  2. Support batched subqueries within a single call (e.g., 10 sensors, one asset, one timestamp range)
  3. Improve documentation and telemetry on query limits, so developers can optimize before hitting errors
  4. (Optional) Add async support for large GraphQL queries with delayed response if needed for scale

Expected Value

Benefit Impact
Reduced app latency Fewer round trips to CDF, less frontend orchestration required
Cleaner, more maintainable code Developers write simpler, declarative GraphQL queries
Broader adoption of CDF GraphQL Teams can use GraphQL directly without needing SDK wrappers
Better operational UX Applications respond more quickly with richer context for operators and engineers

 

Closing

Expanding the current GraphQL query size limits would have a measurable impact on our ability to scale and sustain application development on CDF. It aligns with our desire to use GraphQL as a first-class integration method — not just for dashboards, but for intelligent, plant-facing apps.

We would be happy to participate in design validation or pilot this capability if/when it becomes available.

1 reply

@Andrew Montgomery Hi Andrew, I would like to understand a bit more about the type of queries in GraphQL you are struggling with to better evaluate how we can help you.

Great if you can elaborate on the following:

Querying data for 10 sensors over 24 hours requires multiple GraphQL calls

are you struggling with the amount of timeseries datapoints you can fetch on a timeseries field in your data model or is this normal relational data? Ie. what kind of data are you fetching over 24 hours that requires you to do multiple calls?

 

 

Fetching a list of assets and their most recent alarms or events cannot be done in one query

Is this referring to this type of query not working as expected? 

listAsset {
alarms(sort: { createdTime: DESC }, first: 1) {
...
}
}

Ie. “list assets and give me the associated alarm with the most recent created time for each”

 

Attempting to pull OEE metrics and supporting raw data exceeds query limits if not broken up

Which query limits is exceeded here? I am guessing you are maybe trying to fetch more 99 relations in a single query which is our current limit. If you have an example query you could share that would be helpful.

 

Any more details about the type of queries you would like to do that are not working would be helpful. Also interested in learning more about which Python SDK capability you are saying you could have used to work around the GraphQL limitations.

 

Thanks,

Christian Barth Roligheten