GraphQL: Return full object for custom fields instead of only ID #11907

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

Originally created by @jagter on GitHub (Dec 8, 2025).

NetBox version

v4.4.6

Feature type

Change to existing functionality

Proposed functionality

Currently, when querying custom fields of type object/foreign key via the GraphQL API, only the ID of the related object is returned. The REST API, on the other hand, returns the full object with all its fields.

Current output

"custom_fields": {
    "bgp_asn": [
        776,
        783
    ],

Use case

It would be great if the GraphQL API could also return the full object for custom fields, similar to how the REST API does, instead of only the ID. This would make it easier to consume related objects directly in GraphQL queries without requiring additional lookups.

Database changes

None

External dependencies

None

Originally created by @jagter on GitHub (Dec 8, 2025). ### NetBox version v4.4.6 ### Feature type Change to existing functionality ### Proposed functionality Currently, when querying custom fields of type object/foreign key via the GraphQL API, only the ID of the related object is returned. The REST API, on the other hand, returns the full object with all its fields. **Current output** ``` "custom_fields": { "bgp_asn": [ 776, 783 ], ``` ### Use case It would be great if the GraphQL API could also return the full object for custom fields, similar to how the REST API does, instead of only the ID. This would make it easier to consume related objects directly in GraphQL queries without requiring additional lookups. ### Database changes None ### External dependencies None
adam added the type: featurenetboxstatus: backlogcomplexity: high labels 2025-12-29 21:51:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11907