Repository: saleor/saleor

Issue:
"AttributeError: 'Product' object has no attribute 'node'"
### What I'm trying to achieve
{
  me {
    wishlist(first: 10) {
      totalCount
      edges {
        node {
          product {
            name
          }
        }
      }
    }
  }
}




### Steps to reproduce the problem
1.
{
  "errors": [
    {
      "message": "'Product' object has no attribute 'node'",
      "extensions": {
        "exception": {
          "code": "AttributeError",
          "stacktrace": [
            "Traceback (most recent call last):",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/promise/promise.py\", line 87, in try_catch",
            "    return (handler(*args, **kwargs), None)",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/graphql/execution/executor.py\", line 531, in <lambda>",
            "    lambda resolved: complete_value(",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/graphql/execution/executor.py\", line 546, in complete_value",
            "    return complete_nonnull_value(",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/graphql/execution/executor.py\", line 739, in complete_nonnull_value",
            "    completed = complete_value(",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/graphql/execution/executor.py\", line 571, in complete_value",
            "    return complete_object_value(",
            "  File \"/home/li3/Mahiraj_Workspace/Projects/saleor/venv/lib/python3.9/site-packages/graphql/execution/executor.py\", line 712, in complete_object_value",
            "    if return_type.is_type_of and not return_type.is_type_of(result, info):",
            "  File \"/home/li3/Mahiraj_Workspace/Learning/saleor-demo/saleor/saleor-master/saleor/graphql/channel/types.py\", line 34, in is_type_of",
            "    return super().is_type_of(root.node, info)",
            "AttributeError: 'Product' object has no attribute 'node'"
          ]
        }
      }
    }
  ],
  "data": {
    "me": {
      "wishlist": null
    }
  }
}


### What I expected to happen
{
   "data":{
      "me":{
         "wishlist":{
            "totalCount":1
         }"edges"{
            "node"{
               "product"{
                  "name":"Iphone"
               }
            }
         }
      }
   }

### Screenshots and logs
<!-- If applicable, add screenshots to help explain your problem. -->

**System information**

Saleor version:
- [x] dev (current master)


Operating system:
- [x] Linux




Discussion:

Resolving patch:
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -50,12 +50,7 @@ class Meta:
         description = "Assign attributes to a given product type."
         error_type_class = ProductError
         error_type_field = "product_errors"
-
-    @classmethod
-    def check_permissions(cls, context):
-        return context.user.has_perm(
-            ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES
-        )
+        permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
 
     @classmethod
     def get_operations(cls, info, operations: List[ProductAttributeAssignInput]):
@@ -230,12 +225,7 @@ class Meta:
         description = "Un-assign attributes from a given product type."
         error_type_class = ProductError
         error_type_field = "product_errors"
-
-    @classmethod
-    def check_permissions(cls, context):
-        return context.user.has_perm(
-            ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES
-        )
+        permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
 
     @classmethod
     def save_field_values(cls, product_type, field, pks):


Test patch: