GraphQL error "Expected value of type 'InterfaceType' but got: <VMInterface instance>." when querying interfaces from a VM #9669

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

Originally created by @derdeagle on GitHub (May 14, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.1

Python Version

3.11

Steps to Reproduce

  1. execute the following GraphQL query
{
  virtual_machine_list {
    name
    interfaces {
      mode
    }
  }
}

Expected Behavior

A valid resultset should be returned.

Observed Behavior

The following result containing the error message "Expected value of type 'InterfaceType' but got: ." is being returned.

{
  "data": null,
  "errors": [
    {
      "message": "Expected value of type 'InterfaceType' but got: <VMInterface instance>.",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "path": [
        "virtual_machine_list",
        0,
        "interfaces",
        0
      ]
    }
  ]
}

This can be reproduced on the NetBox demo page.

I updated from 3.7.8 (where it worked as intended) to 4.0.1.

Originally created by @derdeagle on GitHub (May 14, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.1 ### Python Version 3.11 ### Steps to Reproduce 1. execute the following GraphQL query ``` { virtual_machine_list { name interfaces { mode } } } ``` ### Expected Behavior A valid resultset should be returned. ### Observed Behavior The following result containing the error message "Expected value of type 'InterfaceType' but got: <VMInterface instance>." is being returned. ``` { "data": null, "errors": [ { "message": "Expected value of type 'InterfaceType' but got: <VMInterface instance>.", "locations": [ { "line": 4, "column": 5 } ], "path": [ "virtual_machine_list", 0, "interfaces", 0 ] } ] } ``` This can be reproduced on the [NetBox demo page](https://demo.netbox.dev/graphql/). I updated from 3.7.8 (where it worked as intended) to 4.0.1.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:20:39 +01:00
adam closed this issue 2025-12-29 21:20:39 +01:00
Author
Owner

@derdeagle commented on GitHub (May 14, 2024):

@jeremystretch Thank you very much for your quick reaction.

@derdeagle commented on GitHub (May 14, 2024): @jeremystretch Thank you very much for your quick reaction.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9669