Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix failing checkout resolver on User (#18164)

Maciej Korycinskiaca84e6c4252
diff --git a/saleor/graphql/account/tests/mutations/account/test_account_register.py b/saleor/graphql/account/tests/mutations/account/test_account_register.py
index fbaff90664..7858f08068 100644
--- a/saleor/graphql/account/tests/mutations/account/test_account_register.py
+++ b/saleor/graphql/account/tests/mutations/account/test_account_register.py
@@ -38,6 +38,10 @@ mutation RegisterAccount($input: AccountRegisterInput!) {
}
metafield(key: "test")
metafields(keys: ["test1"])
+ checkout{
+ id
+ }
+ checkoutTokens
checkoutIds
checkouts(first: 10) {
edges {
diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.py
index e02a0d28e7..b30031ad86 100644
--- a/saleor/graphql/account/types.py
+++ b/saleor/graphql/account/types.py
@@ -512,7 +512,7 @@ class User(ModelObjectType[models.User]):
@staticmethod
def resolve_checkout(root: models.User, info: ResolveInfo):
if is_newly_created_user(root):
- return []
+ return None
database_connection_name = get_database_connection_name(info.context)
checkout = get_user_checkout(
root, database_connection_name=database_connection_name