-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathschema.py
53 lines (41 loc) · 768 Bytes
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import strawberry
from typing import List, Optional
@strawberry.type
class CommentsType:
id: int
user_id: int
post_id: int
body: str
@strawberry.type
class PostType:
id: int
user_id: int
title: str
body: str
comments: Optional[List[CommentsType]]
@strawberry.type
class UserType:
id: int
name: str
address: str
phone_number: str
sex: str
posts: Optional[List[PostType]]
comments: Optional[List[CommentsType]]
@strawberry.input
class UserInput:
name: str
email: str
address: str
phone_number: str
sex: str
@strawberry.input
class PostInput:
user_id: int
title: str
body: str
@strawberry.input
class CommentInput:
user_id: int
post_id: int
body: str