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

Closed
opened 2025-12-29 21:30:10 +01:00 by adam · 2 comments
Owner

Originally created by @svluder on GitHub (Oct 8, 2024).

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
      ]
    }
  ]
}
Originally created by @svluder on GitHub (Oct 8, 2024). ### 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 3. Create custom field entry: - Name: device_automation - Object Types: DCIM > Device - Type: Selection - Choice set: automation - Remaining settings left with default value 4. 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 ] } ] } ```
adam added the type: bugstatus: duplicatetopic: GraphQLseverity: low labels 2025-12-29 21:30:10 +01:00
adam closed this issue 2025-12-29 21:30:10 +01:00
Author
Owner

@gellis713 commented on GitHub (Oct 14, 2024):

@svluder @arthanson I went through the reproduction steps and can confirm this is the same issue as #17562 which is fixed/merged in #17691

@gellis713 commented on GitHub (Oct 14, 2024): @svluder @arthanson I went through the reproduction steps and can confirm this is the same issue as #17562 which is fixed/merged in #17691
Author
Owner

@jeremystretch commented on GitHub (Oct 15, 2024):

Thanks @gellis713! Going to close this out as a duplicate.

@svluder we believe this has already been resolved under #17562 and will be fixed in the upcoming v4.1.4 release.

@jeremystretch commented on GitHub (Oct 15, 2024): Thanks @gellis713! Going to close this out as a duplicate. @svluder we believe this has already been resolved under #17562 and will be fixed in the upcoming v4.1.4 release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10335