GraphQL Custom Field Object & Multi-Object fields #7474

Closed
opened 2025-12-29 20:23:49 +01:00 by adam · 5 comments
Owner

Originally created by @ryanmerolle on GitHub (Jan 8, 2023).

NetBox version

v3.4.2

Feature type

Change to existing functionality

Proposed functionality

GraphQL currently returns Custom Field Object & Multi-Object fields as their object ids. Similar to the REST API, it would be nice to display the related object details in their entirety.

Use case

The point of graphql is to minimize the number of api queries, but currently this is not the case for custom fields.

Database changes

none

External dependencies

none

Originally created by @ryanmerolle on GitHub (Jan 8, 2023). ### NetBox version v3.4.2 ### Feature type Change to existing functionality ### Proposed functionality GraphQL currently returns Custom Field Object & Multi-Object fields as their object ids. Similar to the REST API, it would be nice to display the related object details in their entirety. ### Use case The point of graphql is to minimize the number of api queries, but currently this is not the case for custom fields. ### Database changes none ### External dependencies none
adam added the type: featurestatus: under review labels 2025-12-29 20:23:49 +01:00
adam closed this issue 2025-12-29 20:23:49 +01:00
Author
Owner

@ryanmerolle commented on GitHub (Jan 12, 2023):

@arthanson sorry to tag you here, but your opinion here on effort and if it should even be tackled is paramaount given your recent work with GraphQL.

@ryanmerolle commented on GitHub (Jan 12, 2023): @arthanson sorry to tag you here, but your opinion here on effort and if it should even be tackled is paramaount given your recent work with GraphQL.
Author
Owner

@arthanson commented on GitHub (Jan 12, 2023):

Not sure off-hand. I'll take a look into it...

@arthanson commented on GitHub (Jan 12, 2023): Not sure off-hand. I'll take a look into it...
Author
Owner

@arthanson commented on GitHub (Mar 22, 2023):

@ryanmerolle can you expand on this a bit, I'm not sure I'm understanding it. For example I have a custom-field set up on tenants, if I do the query:

{
  tenant_list {
    id
    custom_fields
  }
}

I get back:

{
  "data": {
    "tenant_list": [
      {
        "id": "7",
        "custom_fields": {
          "cust_id": "CYB01"
        }
      },
      {
        "id": "5",
        "custom_fields": {
          "cust_id": "DMI01"
        }
      },
      {
        "id": "1",
        "custom_fields": {
          "cust_id": "INI04"
        }
      },

So in this case it is expanded. Can you include a query that shows the issue?

@arthanson commented on GitHub (Mar 22, 2023): @ryanmerolle can you expand on this a bit, I'm not sure I'm understanding it. For example I have a custom-field set up on tenants, if I do the query: ``` { tenant_list { id custom_fields } } ``` I get back: ``` { "data": { "tenant_list": [ { "id": "7", "custom_fields": { "cust_id": "CYB01" } }, { "id": "5", "custom_fields": { "cust_id": "DMI01" } }, { "id": "1", "custom_fields": { "cust_id": "INI04" } }, ``` So in this case it is expanded. Can you include a query that shows the issue?
Author
Owner

@ryanmerolle commented on GitHub (Mar 23, 2023):

Yea I might have been to hasty to include this. I am not sure how this would get tackled, but the point of this FR was to try to follow the relationship of the custom_fields that are related to other objects. IE instead of an id of the field, it would include more about the related object similar to what is found in the api.

I raised it off the back of a user inquiry in slack. Happy to close this if this seems too vague or not worth any ROI.

@ryanmerolle commented on GitHub (Mar 23, 2023): Yea I might have been to hasty to include this. I am not sure how this would get tackled, but the point of this FR was to try to follow the relationship of the custom_fields that are related to other objects. IE instead of an id of the field, it would include more about the related object similar to what is found in the api. I raised it off the back of a user inquiry in slack. Happy to close this if this seems too vague or not worth any ROI.
Author
Owner

@jeremystretch commented on GitHub (May 2, 2023):

Going to close this out as there doesn't seem to be a clear path forward. Happy to revisit should additional detail surface.

@jeremystretch commented on GitHub (May 2, 2023): Going to close this out as there doesn't seem to be a clear path forward. Happy to revisit should additional detail surface.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7474