-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
effcef6
commit 82a97ba
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import strawberry | ||
from typing import List | ||
|
||
@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: List[Book] = strawberry.field(resolver=get_books) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import strawberry | ||
|
||
from .query import Query | ||
|
||
schema = strawberry.Schema( | ||
query=Query | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.