We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic input types were working correctly until version 0.68.4 but after 0.69.0 it's throwing a type error. here's a test for it
0.68.4
0.69.0
def test_generic_input(): E = TypeVar('E') @strawberry.input class EnumInput(Generic[E]): value: E @strawberry.enum class Make(Enum): FORD = 'ford' TOYOTA = 'toyota' HONDA = 'honda' @strawberry.type class Car: make: Make @strawberry.type class Query: @strawberry.field def cars(self, make: Optional[EnumInput[Make]] = None) -> List[Car]: return [] schema = strawberry.Schema(query=Query) query = ''' query CarsList { cars(make: {value: FORD}) { __typename } } ''' result = schema.execute_sync(query) assert result.errors is None
output error
self = <GraphQLObjectType 'Query'> @cached_property def fields(self) -> GraphQLFieldMap: """Get provided fields, wrapping them as GraphQLFields if needed.""" try: fields = resolve_thunk(self._fields) except Exception as error: > raise TypeError(f"{self.name} fields cannot be resolved. {error}") E TypeError: Query fields cannot be resolved. 'EnumDefinition' object has no attribute '__name__' .venv/lib/python3.9/site-packages/graphql/type/definition.py:769: TypeError
The text was updated successfully, but these errors were encountered:
Also fix #1104
fa4b54b
LazyType
Enum
BryceBeagle
Successfully merging a pull request may close this issue.
Generic input types were working correctly until version
0.68.4
but after0.69.0
it's throwing a type error.here's a test for it
output error
The text was updated successfully, but these errors were encountered: