Unbound enum values are None when used in arguments
See original GitHub issueWhen used as a mutation input, enum parameter should be str
, but actually is None
.
def test_executing_mutation_takes_enum():
type_defs = """
type Query {
_: String
}
type Mutation {
eat(meal: Meal!): Int!
}
enum Meal {
SPAM
}
"""
mutation = MutationType()
@mutation.field("eat")
def resolve_eat(*_, meal): # pylint: disable=unused-variable
assert meal == "SPAM"
return 42
schema = make_executable_schema(type_defs, mutation)
result = graphql_sync(schema, 'mutation { eat(meal: SPAM) }')
assert result.errors is None
assert result.data == {"eat": 42}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Generic versions of enum.Enum? #535 - python/typing - GitHub
To me, it seems this could be solved by introducing a generic Enum type in typing, similar to Sequence[T] and the other generics...
Read more >How to get random value of attribute of Enum on each iteration?
As others have said, the best way is to just make random() be a method on your enum class to make it clear...
Read more >Enum HOWTO — Python 3.11.1 documentation
An Enum is a set of symbolic names bound to unique values. They are similar to global variables, but they offer a more...
Read more >Why Swift Enums with Associated Values Cannot Have a Raw ...
First of all, you're not bound to use Integers for the value that is represented by a particular case. You can use Strings,...
Read more >Build Enumerations of Constants With Python's Enum
You can change this initial value using the start argument. Note that defining the above enumerations with the class syntax will produce the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’ve fixed this on master, but in meantime to release hotfix would using
ariadne.EnumType
to set those values explicitly in python:Thanks for report!
Thanks!