1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Use _list appendix for GraphQL list queries

This commit is contained in:
jeremystretch
2021-06-30 09:57:33 -04:00
parent 0d7309cb19
commit 728b3bac67
11 changed files with 81 additions and 82 deletions

View File

@@ -42,8 +42,10 @@ The response will include the requested data formatted as JSON:
NetBox provides both a singular and plural query field for each object type:
* `object`: Returns a single object. Must specify the object's unique ID as `(id: 123)`.
* `objects`: Returns a list of objects, optionally filtered by given parameters.
* `$OBJECT`: Returns a single object. Must specify the object's unique ID as `(id: 123)`.
* `$OBJECT_list`: Returns a list of objects, optionally filtered by given parameters.
For example, query `device(id:123)` to fetch a specific device (identified by its unique ID), and query `device_list` (with an optional set of fitlers) to fetch all devices.
For more detail on constructing GraphQL queries, see the [Graphene documentation](https://docs.graphene-python.org/en/latest/).