Skip to content

Commit 063ef84

Browse files
committed
Fix errors
1 parent 0194fa9 commit 063ef84

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

django/apps/existing_database/test_queries.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ def test_user_query(self):
309309
query = """
310310
query MyQuery($userId: ID!, $pagination: OffsetPaginationInput!) {
311311
user(pk: $userId) {
312+
id
312313
userId
313314
username
314315
userInUserGroups(pagination: $pagination) {
@@ -391,6 +392,7 @@ def test_user_query(self):
391392
assert resp == {
392393
"data": {
393394
"user": {
395+
"id": user.user_id,
394396
"userId": user.user_id,
395397
"username": user.username,
396398
"userInUserGroups": {

django/apps/existing_database/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class UserType:
464464
username: strawberry.auto
465465

466466
@strawberry.field
467-
async def id(self, info: Info, root: UserGroup) -> strawberry.ID:
467+
async def id(self, info: Info, root: User) -> strawberry.ID:
468468
return root.user_id
469469

470470
@strawberry.field
@@ -482,7 +482,7 @@ async def user_in_user_groups(
482482
).values("user_group_id")
483483
)
484484
.annotate(
485-
_user_id=models.Value(root.user_id, output_field=models.IntegerField()),
485+
_user_id=models.Value(root.user_id, output_field=models.CharField()),
486486
user_group_name=models.F("name"),
487487
members_count=models.functions.Coalesce(
488488
models.Subquery(

0 commit comments

Comments
 (0)