Skip to content

Conversation

@gellis713
Copy link
Contributor

Fixes: #17562

Updates extra_choices to be a list of a list of strings which is what Django reports as the relevant types at each level. In addition, it seems some of the test data for extra_choices was a list of strings instead of a nested list.

The form code in CustomFieldChoiceSetForm automatically takes single-items and creates a label so there is a list of tuples being passed into the model.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gellis713!

@jeremystretch jeremystretch merged commit ec89a9b into netbox-community:develop Oct 9, 2024
3 checks passed
@gellis713 gellis713 deleted the 17562-graphql-choiceset branch October 10, 2024 17:16
bctiemann pushed a commit that referenced this pull request Oct 11, 2024
* Align strawberry resolver with expected return type

* Align test data with expected representation of extra_choices in CustomFieldChoiceSet model

---------

Co-authored-by: Griffin Ellis <[email protected]>
jeremystretch pushed a commit to alehaa/netbox that referenced this pull request Oct 11, 2024
* Align strawberry resolver with expected return type

* Align test data with expected representation of extra_choices in CustomFieldChoiceSet model

---------

Co-authored-by: Griffin Ellis <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL CustomFieldChoiceSet erroring on extra_choices

2 participants