Fixes: #21456 - Improve config_context rendering with GraphQL #304

Closed
opened 2026-04-05 16:25:18 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @grische on 2/19/2026

Fixes: #21456

It seems that GraphQL API, unlike the REST API, does not make use of the performance improvement from using ConfigContextModelQuerySet (https://github.com/netbox-community/netbox/pull/5266). This PR adds the necessary config_context annotation to GraphQL queries that request config_context.

It speeds up queries by a factor of >10x with a simple netbox-demo-data setup and even surpases the REST API performance (due it's much smaller overall query) when using:

{
  device_list {
    id
    config_context
  }
}
*Originally created by @grische on 2/19/2026* ### Fixes: #21456 It seems that GraphQL API, unlike the REST API, does not make use of the performance improvement from using ConfigContextModelQuerySet (https://github.com/netbox-community/netbox/pull/5266). This PR adds the necessary config_context annotation to GraphQL queries that request config_context. It speeds up queries by a factor of >10x with a simple netbox-demo-data setup and even surpases the REST API performance (due it's much smaller overall query) when using: ```graphql { device_list { id config_context } } ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#304