Fix the urls.py: exercise2.schema.schema
At the moment we can't query anything related (e.g. members, guests, products) on the SocialClubType
@strawberry.field
random_names(self, info: Info) -> <???>:
return None if True else ["Peter", "Paul", "Amy"]
@strawberry.field
number(self, info: Info) -> <???>:
return None if True else 1
Find the matching return Type
Query:
{
socialClubs {
id
name
members {
id
firstName
lastName
}
guests {
id
firstName
lastName
}
products {
id
name
}
}
}
Result:
{
"data": {
"socialClubs": [
{
"id": "1",
"name": "Social Club No. 0",
"members": [
{
"id": "2",
"firstName": "Mathias",
"lastName": "Hansen"
},
...
],
"guests": [
{
"id": "17",
"firstName": "Vilja",
"lastName": "Bakkan"
},
...
],
"products": [
{
"id": "2",
"name": "Eagle Poisonberry"
},
...
],
}
]
}
}