[PR #6678] [MERGED] Closes #2007: Implement GraphQL API #13154

Closed
opened 2025-12-29 22:25:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/6678
Author: @jeremystretch
Created: 6/29/2021
Status: Merged
Merged: 6/30/2021
Merged by: @jeremystretch

Base: featureHead: 2007-graphql


📝 Commits (10+)

  • 6a07f66 Initial work on GraphQL
  • 930ca8d Add support for custom field data
  • 91d39cc Added initial GraphQL tests
  • d5675a5 Add support for DRF token authentication
  • 4c209ed Clean up GraphQL tests
  • 3e0bcd5 Add GraphQL for IPAM
  • 7a2a25c Use v3.0 enum naming
  • 7256c70 Add GraphQL for extras
  • 881b18f Add GraphQL for tenancy
  • 605b7c5 Add GraphQL for virtualization

📊 Changes

45 files changed (+1456 additions, -10 deletions)

View changed files

📝 base_requirements.txt (+8 -0)
📝 docs/configuration/optional-settings.md (+8 -0)
docs/graphql-api/overview.md (+70 -0)
📝 mkdocs.yml (+2 -0)
netbox/circuits/graphql/__init__.py (+0 -0)
netbox/circuits/graphql/schema.py (+21 -0)
netbox/circuits/graphql/types.py (+50 -0)
netbox/dcim/graphql/__init__.py (+0 -0)
netbox/dcim/graphql/schema.py (+105 -0)
netbox/dcim/graphql/types.py (+353 -0)
📝 netbox/dcim/models/__init__.py (+1 -1)
netbox/extras/graphql/__init__.py (+0 -0)
netbox/extras/graphql/schema.py (+30 -0)
netbox/extras/graphql/types.py (+77 -0)
📝 netbox/extras/tests/test_api.py (+2 -1)
netbox/ipam/graphql/__init__.py (+0 -0)
netbox/ipam/graphql/schema.py (+36 -0)
netbox/ipam/graphql/types.py (+98 -0)
📝 netbox/netbox/api/exceptions.py (+4 -0)
📝 netbox/netbox/configuration.example.py (+3 -0)

...and 25 more files

📄 Description

Closes: #2007

This PR implements a new GraphQL API based on graphene_django at the URL /graphql to complement NetBox's REST API.

A new configuration parameter, GRAPHQL_ENABLED, has been introduced to permit optionally disabling this functionality.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/6678 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 6/29/2021 **Status:** ✅ Merged **Merged:** 6/30/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `2007-graphql` --- ### 📝 Commits (10+) - [`6a07f66`](https://github.com/netbox-community/netbox/commit/6a07f66cfc5f9215d192669a180d6858f6cadffa) Initial work on GraphQL - [`930ca8d`](https://github.com/netbox-community/netbox/commit/930ca8d9a1d20019fd8618f8ce92b97beae5ed2b) Add support for custom field data - [`91d39cc`](https://github.com/netbox-community/netbox/commit/91d39cc0c00e85aa4a3992bdfa697aa0dba2baf6) Added initial GraphQL tests - [`d5675a5`](https://github.com/netbox-community/netbox/commit/d5675a5d4ae2ce435dc972417020527764730ae6) Add support for DRF token authentication - [`4c209ed`](https://github.com/netbox-community/netbox/commit/4c209ed74c341fd954bda7e18354d865b2e52011) Clean up GraphQL tests - [`3e0bcd5`](https://github.com/netbox-community/netbox/commit/3e0bcd58d486c24ea2ce3a0cd569cb78d0450e48) Add GraphQL for IPAM - [`7a2a25c`](https://github.com/netbox-community/netbox/commit/7a2a25c13a61c6341cdef929fd2487456ba3d441) Use v3.0 enum naming - [`7256c70`](https://github.com/netbox-community/netbox/commit/7256c7050ad6dbba6b64a5038b2192e9cf4e1d96) Add GraphQL for extras - [`881b18f`](https://github.com/netbox-community/netbox/commit/881b18f6d0361ff2a882d74933420ffa3b866dba) Add GraphQL for tenancy - [`605b7c5`](https://github.com/netbox-community/netbox/commit/605b7c5b3eead23d2a4531878dc64278d693fb12) Add GraphQL for virtualization ### 📊 Changes **45 files changed** (+1456 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `base_requirements.txt` (+8 -0) 📝 `docs/configuration/optional-settings.md` (+8 -0) ➕ `docs/graphql-api/overview.md` (+70 -0) 📝 `mkdocs.yml` (+2 -0) ➕ `netbox/circuits/graphql/__init__.py` (+0 -0) ➕ `netbox/circuits/graphql/schema.py` (+21 -0) ➕ `netbox/circuits/graphql/types.py` (+50 -0) ➕ `netbox/dcim/graphql/__init__.py` (+0 -0) ➕ `netbox/dcim/graphql/schema.py` (+105 -0) ➕ `netbox/dcim/graphql/types.py` (+353 -0) 📝 `netbox/dcim/models/__init__.py` (+1 -1) ➕ `netbox/extras/graphql/__init__.py` (+0 -0) ➕ `netbox/extras/graphql/schema.py` (+30 -0) ➕ `netbox/extras/graphql/types.py` (+77 -0) 📝 `netbox/extras/tests/test_api.py` (+2 -1) ➕ `netbox/ipam/graphql/__init__.py` (+0 -0) ➕ `netbox/ipam/graphql/schema.py` (+36 -0) ➕ `netbox/ipam/graphql/types.py` (+98 -0) 📝 `netbox/netbox/api/exceptions.py` (+4 -0) 📝 `netbox/netbox/configuration.example.py` (+3 -0) _...and 25 more files_ </details> ### 📄 Description ### Closes: #2007 This PR implements a new GraphQL API based on [graphene_django](https://github.com/graphql-python/graphene-django) at the URL `/graphql` to complement NetBox's REST API. A new configuration parameter, `GRAPHQL_ENABLED`, has been introduced to permit optionally disabling this functionality. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:25:42 +01:00
adam closed this issue 2025-12-29 22:25:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13154