Skip to content

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

@jagter

Description

@jagter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: highExpected to require a large amont of time and effort to implement relative to other tasksnetboxstatus: backlogAwaiting selection for worktype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions