Skip to content

Invalid GraphQL output after deleting object used for object-type Custom Field #12635

Open
@mikkelmk

Description

@mikkelmk

NetBox version

v3.5.1

Python version

3.10

Steps to Reproduce

  1. Create object-type custom field with Interface as content type and Tag as object type
  2. Assign a tag to this custom field on an interface
  3. Delete the tag
  4. Querying the custom fields on the interface through GraphQL will still show the field as being set to the id of the deleted tag

Expected Behavior

GraphQL output like this:

{
  "data": {
    "interface": {
      "custom_fields": {
        "FooCustomField": null
      }
    }
  }
}

Observed Behavior

GraphQL output like this:

{
  "data": {
    "interface": {
      "custom_fields": {
        "FooCustomField": 42
      }
    }
  }
}

Note that the field will be null in both the Web interface and REST API - I believe that what happens is that the underlying custom_field_data on the interface is not cleared, but that the Web/API layer knows to nullify the invalid reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions