Skip to content

Strawberry GraphQL API - Error handling extra_choices attribute of choice_set object #17706

Closed as not planned
@svluder

Description

@svluder

Deployment Type

Self-hosted

NetBox Version

v4.1.3

Python Version

3.12

Steps to Reproduce

  1. Freshly installed / vanilla setup of Netbox 4.1.3
  2. Create Custom Field Choice set entry:
  • Name: automation
  • Choices:
    • enabled:enabled
    • disabled:disabled
  1. Create custom field entry:
  • Name: device_automation
  • Object Types: DCIM > Device
  • Type: Selection
  • Choice set: automation
  • Remaining settings left with default value
  1. Run the following GraphQL query in GraphQL client page:
{
  custom_field_list
    {
      name,
      choice_set {
        extra_choices
      }
    }
}

Expected Behavior

Output of custom field object device_automation including extra_choices should be shown.

Observed Behavior

{
  "data": {
    "custom_field_list": [
      {
        "name": "device_automation",
        "choice_set": {
          "extra_choices": null
        }
      }
    ]
  },
  "errors": [
    {
      "message": "String cannot represent value: ['enabled', 'enabled']",
      "locations": [
        {
          "line": 6,
          "column": 9
        }
      ],
      "path": [
        "custom_field_list",
        0,
        "choice_set",
        "extra_choices",
        0
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: duplicateThis issue has already been raisedtopic: GraphQLtype: 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