add some comments

pull/39/head v0.0.1-beta
Ciro 2022-11-15 10:44:44 -03:00
rodzic 29cafd0414
commit 976c22f02f
2 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -15,6 +15,8 @@ class User:
class Query:
@strawberry.field
def user(self) -> Optional[User]:
# self.context is an dict with headers, query, and params properties
# headers and query are dict and params an array with route parameters
return User(name="Hello")

Wyświetl plik

@ -11,6 +11,7 @@ async def auth(res, req, data=None):
user = await get_user(req.get_header('authorization'))
if not user:
res.write_status(403).end("not authorized")
#returning Falsy in middlewares just stop the execution of the next middleware
return False
#returns extra data