Add enum support to filters and fix filter typing (v3)#1119
Merged
zbyte64 merged 2 commits intographql-python:mainfrom Feb 23, 2021
Merged
Add enum support to filters and fix filter typing (v3)#1119zbyte64 merged 2 commits intographql-python:mainfrom
zbyte64 merged 2 commits intographql-python:mainfrom
Conversation
Collaborator
tcleonard
commented
Feb 16, 2021
- Add filtering support for choice fields converted to graphql Enum (or not)
- Fix type of various filters (used to default to String)
- Fix bug with contains introduced in previous PR
- Fix bug with declared filters being overridden (see PR Only override non declared filters #1108)
- Fix support for ArrayField and add documentation

added 2 commits
February 13, 2021 17:04
…or not) - Fix type of various filters (used to default to String) - Fix bug with contains introduced in previous PR - Fix bug with declared filters being overridden (see PR graphql-python#1108) - Fix support for ArrayField and add documentation
zbyte64
approved these changes
Feb 16, 2021
Collaborator
zbyte64
left a comment
There was a problem hiding this comment.
Amazing work, just have the one question with regards to order_by
| if k == "order_by" and v is not None: | ||
| v = to_snake_case(v) | ||
| kwargs[k] = v | ||
| kwargs[k] = convert_enum(v) |
Collaborator
There was a problem hiding this comment.
Does this mean order_by arguments can be an enum, or does this have any other impact?
Collaborator
Author
There was a problem hiding this comment.
no, order_by have to be strings since it is supposed to be the name of the field you want to order by (and to_snake_case only works for strings)
convert_enum method only transform Enums and leave other things untouched (so a string wouldn't get modified by the function)
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.