Skip to content

Graphql error returned when querying IP addresses and returning assigned_object in v4.0-beta1 #15809

Closed
@atownson

Description

@atownson

Deployment Type

Self-hosted

NetBox Version

v4.0-beta1

Python Version

3.10

Steps to Reproduce

Run the following query against the Strawberry Graphql endpoint:

{
  ip_address_list {
    id
    assigned_object {
      __typename
      ... on InterfaceType {
        id
        name
        device {
          name
        }
      }
      ... on FHRPGroupType {
        id
        name
      }
      ... on VMInterfaceType {
        id
        name
      }
    }
  }
}

Expected Behavior

The expected results are returned:

{
  "data": {
    "ip_address_list": [
      {
        "id": "1",
        "assigned_object": {
          "__typename": "InterfaceType",
          "id": "1",
          "name": "GigabitEthernet0/0/0",
          "device": {
            "name": "test"
          }
        }
      },
      {
        "id": "2",
        "assigned_object": null
      }
    ]
  }
}

Observed Behavior

An error response is returned:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot return null for non-nullable field IPAddressType.assigned_object.",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "path": [
        "ip_address_list",
        2,
        "assigned_object"
      ]
    }
  ]
}

Metadata

Metadata

Assignees

Labels

betaConcerns a bug/feature in a beta releaseseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions