Skip to content

Namespace GraphQL queries by app #19736

Open
@jeremystretch

Description

@jeremystretch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: mediumRequires a substantial but not unusual amount of effort to implementneeds milestoneAwaiting prioritization for inclusion with a future NetBox releasestatus: backlogAwaiting selection for worktopic: GraphQLtype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions