Enable plugins to extend the GraphQL API #8405
Labels
status: accepted
This issue has been accepted for implementation
topic: plugins
Relates to the plugins framework
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v3.1.6
Feature type
New functionality
Proposed functionality
Provide a mechanism through which a NetBox plugin can extend the GraphQL API with its own query class(es). I don't have a strong opinion on the optimal way to achieve this, but it should be fairly straightforward.
Currently, the GraphQL schema is formed by combining the root query from each app within NetBox:
We can extend this approach to allow dynamic inclusions. Something like:
get_plugin_queries()
above is just a placeholder function, but we can probably handle the registration of GraphQL queries the same way we do for template extensions and navigation menu items today (by designating a configurable path to a variable within the plugin which contains these components).This was originally proposed by @Jenjen1324 in WG83333.
Use case
This enables plugins to extend NetBox's GraphQL API, e.g. to add their own models.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: