Namespace GraphQL queries by app #11300

Open
opened 2025-12-29 21:43:16 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jun 20, 2025).

NetBox version

v4.3.2

Feature type

Change to existing functionality

Proposed functionality

Currently, the GraphQL API is flat: All model queries are available under the root query. For example, querying sites:

{
    site_list {
        id
        name
    }
}

This FR proposes nesting queries within their core app or plugin, to effectively namespace queries and prevent collisions. The above query would become:

{
    dcim {
        site_list {
            id
            name
        }
    }
}

Use case

This change will protect against name collisions in the case where two plugins have a model with the same name, or where a plugin model has the same name as a core model.

Database changes

None

External dependencies

None

Originally created by @jeremystretch on GitHub (Jun 20, 2025). ### NetBox version v4.3.2 ### Feature type Change to existing functionality ### Proposed functionality Currently, the GraphQL API is flat: All model queries are available under the root query. For example, querying sites: ``` { site_list { id name } } ``` This FR proposes nesting queries within their core app or plugin, to effectively namespace queries and prevent collisions. The above query would become: ``` { dcim { site_list { id name } } } ``` ### Use case This change will protect against name collisions in the case where two plugins have a model with the same name, or where a plugin model has the same name as a core model. ### Database changes None ### External dependencies None
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11300