I'm trying to follow the documentation, but when I run the code from Testing
section I get the error GraphQLError("Unknown argument 'title' on field 'Query.books'.", ...
.
It's said that we should use the schema from the Getting Started tutorial. The code is:
import typing
import strawberry
@strawberry.type
class Book:
title: str
author: str
def get_books():
return [
Book(
title="The Great Gatsby",
author="F. Scott Fitzgerald",
),
]
@strawberry.type
class Query:
books: typing.List[Book] = strawberry.field(resolver=get_books)
schema = strawberry.Schema(query=Query)
I think we have to either add title
parameter to get_books
or remove title
parameter from TestQuery
.
Ready to send a PR if it's needed
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too