|
2 | 2 | from typing import Optional |
3 | 3 |
|
4 | 4 | from ariadne import ObjectType |
| 5 | +from graphql import GraphQLResolveInfo |
5 | 6 |
|
6 | 7 | from codecov_auth.models import Owner |
7 | 8 | from graphql_api.helpers.ariadne import ariadne_load_local_graphql |
|
12 | 13 |
|
13 | 14 |
|
14 | 15 | @user_bindable.field("username") |
15 | | -def resolve_username(user: Owner) -> str: |
| 16 | +def resolve_username(user: Owner, info: GraphQLResolveInfo) -> str: |
16 | 17 | return user.username |
17 | 18 |
|
18 | 19 |
|
19 | 20 | @user_bindable.field("name") |
20 | | -def resolve_name(user: Owner) -> Optional[str]: |
| 21 | +def resolve_name(user: Owner, info: GraphQLResolveInfo) -> Optional[str]: |
21 | 22 | return user.name |
22 | 23 |
|
23 | 24 |
|
24 | 25 | @user_bindable.field("avatarUrl") |
25 | | -def resolve_avatar_url(user: Owner) -> str: |
| 26 | +def resolve_avatar_url(user: Owner, info: GraphQLResolveInfo) -> str: |
26 | 27 | return user.avatar_url |
27 | 28 |
|
28 | 29 |
|
29 | 30 | @user_bindable.field("student") |
30 | | -def resolve_student(user: Owner) -> bool: |
| 31 | +def resolve_student(user: Owner, info: GraphQLResolveInfo) -> bool: |
31 | 32 | return user.student |
32 | 33 |
|
33 | 34 |
|
34 | 35 | @user_bindable.field("studentCreatedAt") |
35 | | -def resolve_student_created_at(user: Owner) -> Optional[datetime]: |
| 36 | +def resolve_student_created_at( |
| 37 | + user: Owner, info: GraphQLResolveInfo |
| 38 | +) -> Optional[datetime]: |
36 | 39 | return user.student_created_at |
37 | 40 |
|
38 | 41 |
|
39 | 42 | @user_bindable.field("studentUpdatedAt") |
40 | | -def resolve_student_updated_at(user: Owner) -> Optional[datetime]: |
| 43 | +def resolve_student_updated_at( |
| 44 | + user: Owner, info: GraphQLResolveInfo |
| 45 | +) -> Optional[datetime]: |
41 | 46 | return user.student_updated_at |
42 | 47 |
|
43 | 48 |
|
44 | 49 | # this will no longer be updated from the UI |
45 | 50 | @user_bindable.field("customerIntent") |
46 | | -def resolve_customer_intent(user: Owner) -> Optional[str]: |
| 51 | +def resolve_customer_intent(user: Owner, info: GraphQLResolveInfo) -> str: |
47 | 52 | owner = user |
48 | 53 | if not owner.user: |
49 | 54 | return None |
|
0 commit comments