assigned_object_id type does not match id type in graphql output #7133

Closed
opened 2025-12-29 20:19:36 +01:00 by adam · 1 comment
Owner

Originally created by @neuro42 on GitHub (Oct 19, 2022).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.3.4

Python version

3.9

Steps to Reproduce

  1. Have a device created with a primary_ip4 assigned to one of its interfaces
  2. GraphQL query such as:
{
  device_list(name:"DEVICE") {
    primary_ip4 {
      assigned_object_id
    }
    interfaces {
      id
    }
  }
}

Expected Behavior

primary_ip4.assigned_object_id and interfaces.id to have the same type so they can be compared without typecasting either assigned_object_id to a string, or the object id to an integer. This may affect other models than primary_ip#, but is where I ran into it.

Observed Behavior

assigned_object_id is an integer (unquoted) in GraphQL output, while the id returned from the interface is a string (quoted) in GraphQL output.

Originally created by @neuro42 on GitHub (Oct 19, 2022). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.3.4 ### Python version 3.9 ### Steps to Reproduce 1. Have a device created with a primary_ip4 assigned to one of its interfaces 2. GraphQL query such as: ``` { device_list(name:"DEVICE") { primary_ip4 { assigned_object_id } interfaces { id } } } ``` ### Expected Behavior primary_ip4.assigned_object_id and interfaces.id to have the same type so they can be compared without typecasting either assigned_object_id to a string, or the object id to an integer. This may affect other models than primary_ip#, but is where I ran into it. ### Observed Behavior assigned_object_id is an integer (unquoted) in GraphQL output, while the id returned from the interface is a string (quoted) in GraphQL output.
adam added the type: bug label 2025-12-29 20:19:36 +01:00
adam closed this issue 2025-12-29 20:19:37 +01:00
Author
Owner

@arthanson commented on GitHub (Oct 24, 2022):

Closing, this becomes a non-issue with the 3.4 updates. now instead of assigned_object_id it is assigned_object and you can use fragments to get the id.

@arthanson commented on GitHub (Oct 24, 2022): Closing, this becomes a non-issue with the 3.4 updates. now instead of assigned_object_id it is assigned_object and you can use fragments to get the id.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7133