Open gellis713 opened 2 days ago
I already have a fix for this issue which is to replace the following in netbox/extras/types.py (note extra_choices should be List[List[str]]
class CustomFieldChoiceSetType(ObjectType):
choices_for: List[Annotated["CustomFieldType", strawberry.lazy('extras.graphql.types')]]
extra_choices: List[str] | None
with
class CustomFieldChoiceSetType(ObjectType):
choices_for: List[Annotated["CustomFieldType", strawberry.lazy('extras.graphql.types')]]
extra_choices: List[List[str]] | None
@gellis713 Assigning you to the issue as it looks like you have a PR. Note, I was actually getting an error on the GraphQL query:
{
"data": {
"custom_field_choice_set_list": [
{
"id": "1",
"extra_choices": null
}
]
},
"errors": [
{
"message": "String cannot represent value: ['A', 'A']",
"locations": [
{
"line": 4,
"column": 5
}
],
"path": [
"custom_field_choice_set_list",
0,
"extra_choices",
0
]
}
]
}
@arthanson Yes it appears you have the same observed behavior that I posted in the issue report. Glad to see it was reproducible. Is there anything I can/should do while waiting for the PR to be reviewed? Thanks
Deployment Type
Self-hosted
NetBox Version
v4.1.1
Python Version
3.12
Steps to Reproduce
1: Create a new custom field choice set called "MY_CHOICE_SET" under Customization -> Custom Field Choices. In the "Extra choices" field enter:
2: Try to execute following graphql query from the API or from the web interface. Replace MY_CHOICE_SET with
Expected Behavior
Returned JSON:
Observed Behavior
Returned JSON: