from typing import List

import graphene

from ...core import models as core_models
from ...webhook import models
from ...webhook.deprecated_event_types import WebhookEventType
from ...webhook.event_types import WebhookEventAsyncType, WebhookEventSyncType
from ..core import ResolveInfo
from ..core.connection import (
    CountableConnection,
    create_connection_slice,
    filter_connection_queryset,
)
from ..core.descriptions import ADDED_IN_312, DEPRECATED_IN_3X_FIELD, PREVIEW_FEATURE
from ..core.fields import FilterConnectionField, JSONString
from ..core.types import ModelObjectType, NonNullList
from ..webhook.enums import EventDeliveryStatusEnum, WebhookEventTypeEnum
from ..webhook.filters import EventDeliveryFilterInput
from ..webhook.sorters import (
    EventDeliveryAttemptSortingInput,
    EventDeliverySortingInput,
)
from . import enums
from .dataloaders import PayloadByIdLoader, WebhookEventsByWebhookIdLoader


class WebhookEvent(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return WebhookEventType.DISPLAY_LABELS.get(root.event_type) or root.event_type


class WebhookEventAsync(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeAsyncEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Asynchronous webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return (
            WebhookEventAsyncType.DISPLAY_LABELS.get(root.event_type) or root.event_type
        )


class WebhookEventSync(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeSyncEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Synchronous webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return (
            WebhookEventSyncType.DISPLAY_LABELS.get(root.event_type) or root.event_type
        )


class EventDeliveryAttempt(ModelObjectType[core_models.EventDeliveryAttempt]):
    id = graphene.GlobalID(required=True)
    created_at = graphene.DateTime(
        description="Event delivery creation date and time.", required=True
    )
    task_id = graphene.String(description="Task id for delivery attempt.")
    duration = graphene.Float(description="Delivery attempt duration.")
    response = graphene.String(description="Delivery attempt response content.")
    response_headers = graphene.String(
        description="Response headers for delivery attempt."
    )
    response_status_code = graphene.Int(
        description="Delivery attempt response status code."
    )
    request_headers = graphene.String(
        description="Request headers for delivery attempt."
    )
    status = EventDeliveryStatusEnum(
        description="Event delivery status.", required=True
    )

    class Meta:
        description = "Event delivery attempts."
        model = core_models.EventDeliveryAttempt
        interfaces = [graphene.relay.Node]


class EventDeliveryAttemptCountableConnection(CountableConnection):
    class Meta:
        node = EventDeliveryAttempt


class EventDelivery(ModelObjectType[core_models.EventDelivery]):
    id = graphene.GlobalID(required=True)
    created_at = graphene.DateTime(required=True)
    status = EventDeliveryStatusEnum(
        description="Event delivery status.", required=True
    )
    event_type = WebhookEventTypeEnum(description="Webhook event type.", required=True)
    attempts = FilterConnectionField(
        EventDeliveryAttemptCountableConnection,
        sort_by=EventDeliveryAttemptSortingInput(description="Event delivery sorter"),
        description="Event delivery attempts.",
    )
    payload = graphene.String(description="Event payload.")

    class Meta:
        description = "Event delivery."
        model = core_models.EventDelivery
        interfaces = [graphene.relay.Node]

    @staticmethod
    def resolve_attempts(root: core_models.EventDelivery, info: ResolveInfo, **kwargs):
        qs = core_models.EventDeliveryAttempt.objects.filter(delivery=root)
        qs = filter_connection_queryset(qs, kwargs)
        return create_connection_slice(
            qs, info, kwargs, EventDeliveryAttemptCountableConnection
        )

    @staticmethod
    def resolve_payload(root: core_models.EventDelivery, info: ResolveInfo):
        if not root.payload_id:
            return None
        return PayloadByIdLoader(info.context).load(root.payload_id)


class EventDeliveryCountableConnection(CountableConnection):
    class Meta:
        node = EventDelivery


class Webhook(ModelObjectType[models.Webhook]):
    id = graphene.GlobalID(required=True)
    name = graphene.String(required=True)
    events = NonNullList(
        WebhookEvent,
        description="List of webhook events.",
        deprecation_reason=(
            f"{DEPRECATED_IN_3X_FIELD} Use `asyncEvents` or `syncEvents` instead."
        ),
        required=True,
    )
    sync_events = NonNullList(
        WebhookEventSync,
        description="List of synchronous webhook events.",
        required=True,
    )
    async_events = NonNullList(
        WebhookEventAsync,
        description="List of asynchronous webhook events.",
        required=True,
    )
    app = graphene.Field("saleor.graphql.app.types.App", required=True)
    event_deliveries = FilterConnectionField(
        EventDeliveryCountableConnection,
        sort_by=EventDeliverySortingInput(description="Event delivery sorter."),
        filter=EventDeliveryFilterInput(description="Event delivery filter options."),
        description="Event deliveries.",
    )
    target_url = graphene.String(required=True, description="Target URL for webhook.")
    is_active = graphene.Boolean(
        required=True, description="Informs if webhook is activated."
    )
    secret_key = graphene.String(
        description="Used to create a hash signature for each payload.",
        deprecation_reason=(
            f"{DEPRECATED_IN_3X_FIELD} As of Saleor 3.5, webhook payloads default to "
            "signing using a verifiable JWS."
        ),
    )
    subscription_query = graphene.String(
        description="Used to define payloads for specific events."
    )
    custom_headers = JSONString(
        description="Custom headers, which will be added to HTTP request."
        + ADDED_IN_312
        + PREVIEW_FEATURE
    )

    class Meta:
        description = "Webhook."
        model = models.Webhook
        interfaces = [graphene.relay.Node]

    @staticmethod
    def resolve_async_events(root: models.Webhook, info: ResolveInfo):
        def _filter_by_async_type(webhook_events: List[WebhookEvent]):
            return filter(
                lambda webhook_event: webhook_event.event_type
                in WebhookEventAsyncType.ALL,
                webhook_events,
            )

        return (
            WebhookEventsByWebhookIdLoader(info.context)
            .load(root.id)
            .then(_filter_by_async_type)
        )

    @staticmethod
    def resolve_sync_events(root: models.Webhook, info: ResolveInfo):
        def _filter_by_sync_type(webhook_events: List[WebhookEvent]):
            return filter(
                lambda webhook_event: webhook_event.event_type
                in WebhookEventSyncType.ALL,
                webhook_events,
            )

        return (
            WebhookEventsByWebhookIdLoader(info.context)
            .load(root.id)
            .then(_filter_by_sync_type)
        )

    @staticmethod
    def resolve_events(root: models.Webhook, info: ResolveInfo):
        return WebhookEventsByWebhookIdLoader(info.context).load(root.id)

    @staticmethod
    def resolve_event_deliveries(root: models.Webhook, info: ResolveInfo, **kwargs):
        qs = core_models.EventDelivery.objects.filter(webhook_id=root.pk)
        qs = filter_connection_queryset(qs, kwargs)
        return create_connection_slice(
            qs, info, kwargs, EventDeliveryCountableConnection
        )

saleor/graphql/webhook/types.py
from typing import List

import graphene

from ...core import models as core_models
from ...webhook import models
from ...webhook.deprecated_event_types import WebhookEventType
from ...webhook.event_types import WebhookEventAsyncType, WebhookEventSyncType
from ..core import ResolveInfo
from ..core.connection import (
    CountableConnection,
    create_connection_slice,
    filter_connection_queryset,
)
from ..core.descriptions import ADDED_IN_312, DEPRECATED_IN_3X_FIELD, PREVIEW_FEATURE
from ..core.fields import FilterConnectionField, JSONString
from ..core.types import ModelObjectType, NonNullList
from ..webhook.enums import EventDeliveryStatusEnum, WebhookEventTypeEnum
from ..webhook.filters import EventDeliveryFilterInput
from ..webhook.sorters import (
    EventDeliveryAttemptSortingInput,
    EventDeliverySortingInput,
)
from . import enums
from .dataloaders import PayloadByIdLoader, WebhookEventsByWebhookIdLoader


class WebhookEvent(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return WebhookEventType.DISPLAY_LABELS.get(root.event_type) or root.event_type


class WebhookEventAsync(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeAsyncEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Asynchronous webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return (
            WebhookEventAsyncType.DISPLAY_LABELS.get(root.event_type) or root.event_type
        )


class WebhookEventSync(ModelObjectType[models.WebhookEvent]):
    name = graphene.String(description="Display name of the event.", required=True)
    event_type = enums.WebhookEventTypeSyncEnum(
        description="Internal name of the event type.", required=True
    )

    class Meta:
        model = models.WebhookEvent
        description = "Synchronous webhook event."

    @staticmethod
    def resolve_name(root: models.WebhookEvent, _info):
        return (
            WebhookEventSyncType.DISPLAY_LABELS.get(root.event_type) or root.event_type
        )


class EventDeliveryAttempt(ModelObjectType[core_models.EventDeliveryAttempt]):
    id = graphene.GlobalID(required=True)
    created_at = graphene.DateTime(
        description="Event delivery creation date and time.", required=True
    )
    task_id = graphene.String(description="Task id for delivery attempt.")
    duration = graphene.Float(description="Delivery attempt duration.")
    response = graphene.String(description="Delivery attempt response content.")
    response_headers = graphene.String(
        description="Response headers for delivery attempt."
    )
    response_status_code = graphene.Int(
        description="Delivery attempt response status code."
    )
    request_headers = graphene.String(
        description="Request headers for delivery attempt."
    )
    status = EventDeliveryStatusEnum(
        description="Event delivery status.", required=True
    )

    class Meta:
        description = "Event delivery attempts."
        model = core_models.EventDeliveryAttempt
        interfaces = [graphene.relay.Node]


class EventDeliveryAttemptCountableConnection(CountableConnection):
    class Meta:
        node = EventDeliveryAttempt


class EventDelivery(ModelObjectType[core_models.EventDelivery]):
    id = graphene.GlobalID(required=True)
    created_at = graphene.DateTime(required=True)
    status = EventDeliveryStatusEnum(
        description="Event delivery status.", required=True
    )
    event_type = WebhookEventTypeEnum(description="Webhook event type.", required=True)
    attempts = FilterConnectionField(
        EventDeliveryAttemptCountableConnection,
        sort_by=EventDeliveryAttemptSortingInput(description="Event delivery sorter"),
        description="Event delivery attempts.",
    )
    payload = graphene.String(description="Event payload.")

    class Meta:
        description = "Event delivery."
        model = core_models.EventDelivery
        interfaces = [graphene.relay.Node]

    @staticmethod
    def resolve_attempts(root: core_models.EventDelivery, info: ResolveInfo, **kwargs):
        qs = core_models.EventDeliveryAttempt.objects.filter(delivery=root)
        qs = filter_connection_queryset(qs, kwargs)
        return create_connection_slice(
            qs, info, kwargs, EventDeliveryAttemptCountableConnection
        )

    @staticmethod
    def resolve_payload(root: core_models.EventDelivery, info: ResolveInfo):
        if not root.payload_id:
            return None
        return PayloadByIdLoader(info.context).load(root.payload_id)


class EventDeliveryCountableConnection(CountableConnection):
    class Meta:
        node = EventDelivery


class Webhook(ModelObjectType[models.Webhook]):
    id = graphene.GlobalID(required=True)
    name = graphene.String(required=False)
    events = NonNullList(
        WebhookEvent,
        description="List of webhook events.",
        deprecation_reason=(
            f"{DEPRECATED_IN_3X_FIELD} Use `asyncEvents` or `syncEvents` instead."
        ),
        required=True,
    )
    sync_events = NonNullList(
        WebhookEventSync,
        description="List of synchronous webhook events.",
        required=True,
    )
    async_events = NonNullList(
        WebhookEventAsync,
        description="List of asynchronous webhook events.",
        required=True,
    )
    app = graphene.Field("saleor.graphql.app.types.App", required=True)
    event_deliveries = FilterConnectionField(
        EventDeliveryCountableConnection,
        sort_by=EventDeliverySortingInput(description="Event delivery sorter."),
        filter=EventDeliveryFilterInput(description="Event delivery filter options."),
        description="Event deliveries.",
    )
    target_url = graphene.String(required=True, description="Target URL for webhook.")
    is_active = graphene.Boolean(
        required=True, description="Informs if webhook is activated."
    )
    secret_key = graphene.String(
        description="Used to create a hash signature for each payload.",
        deprecation_reason=(
            f"{DEPRECATED_IN_3X_FIELD} As of Saleor 3.5, webhook payloads default to "
            "signing using a verifiable JWS."
        ),
    )
    subscription_query = graphene.String(
        description="Used to define payloads for specific events."
    )
    custom_headers = JSONString(
        description="Custom headers, which will be added to HTTP request."
        + ADDED_IN_312
        + PREVIEW_FEATURE
    )

    class Meta:
        description = "Webhook."
        model = models.Webhook
        interfaces = [graphene.relay.Node]

    @staticmethod
    def resolve_async_events(root: models.Webhook, info: ResolveInfo):
        def _filter_by_async_type(webhook_events: List[WebhookEvent]):
            return filter(
                lambda webhook_event: webhook_event.event_type
                in WebhookEventAsyncType.ALL,
                webhook_events,
            )

        return (
            WebhookEventsByWebhookIdLoader(info.context)
            .load(root.id)
            .then(_filter_by_async_type)
        )

    @staticmethod
    def resolve_sync_events(root: models.Webhook, info: ResolveInfo):
        def _filter_by_sync_type(webhook_events: List[WebhookEvent]):
            return filter(
                lambda webhook_event: webhook_event.event_type
                in WebhookEventSyncType.ALL,
                webhook_events,
            )

        return (
            WebhookEventsByWebhookIdLoader(info.context)
            .load(root.id)
            .then(_filter_by_sync_type)
        )

    @staticmethod
    def resolve_events(root: models.Webhook, info: ResolveInfo):
        return WebhookEventsByWebhookIdLoader(info.context).load(root.id)

    @staticmethod
    def resolve_event_deliveries(root: models.Webhook, info: ResolveInfo, **kwargs):
        qs = core_models.EventDelivery.objects.filter(webhook_id=root.pk)
        qs = filter_connection_queryset(qs, kwargs)
        return create_connection_slice(
            qs, info, kwargs, EventDeliveryCountableConnection
        )

saleor/graphql/webhook/types.py
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cca5d813e33..46d2b981685 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ All notable, unreleased changes to this project will be documented in this file.
 
 ### Other changes
 - Expand metric units to support more types of products. - #13043 by @FremahA
+- Fix Error Cannot return null for non-nullable field Webhook.name. - #12989 by @cyborg7898
 
 # 3.14.0
 
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 26d95cbc5d6..6942d391699 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -1609,7 +1609,7 @@ type Query {
 """Webhook."""
 type Webhook implements Node @doc(category: "Webhooks") {
   id: ID!
-  name: String!
+  name: String
 
   """List of webhook events."""
   events: [WebhookEvent!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead.")
diff --git a/saleor/graphql/webhook/tests/queries/test_webhook.py b/saleor/graphql/webhook/tests/queries/test_webhook.py
index aa0a379b4eb..73d6ebd898c 100644
--- a/saleor/graphql/webhook/tests/queries/test_webhook.py
+++ b/saleor/graphql/webhook/tests/queries/test_webhook.py
@@ -14,6 +14,7 @@
       webhook(id: $id) {
         id
         isActive
+        name
         subscriptionQuery
         asyncEvents {
           eventType
@@ -167,3 +168,18 @@ def test_webhook_with_invalid_object_type(
     response = staff_api_client.post_graphql(QUERY_WEBHOOK, variables)
     content = get_graphql_content(response)
     assert content["data"]["webhook"] is None
+
+
+def test_webhook_without_name(
+    staff_api_client, webhook_without_name, permission_manage_apps
+):
+    query = QUERY_WEBHOOK
+    webhook_id = graphene.Node.to_global_id("Webhook", webhook_without_name.pk)
+    variables = {"id": webhook_id}
+    staff_api_client.user.user_permissions.add(permission_manage_apps)
+    response = staff_api_client.post_graphql(query, variables=variables)
+    content = get_graphql_content(response)
+    webhook_response = content["data"]["webhook"]
+    assert webhook_response["name"] is None
+    events = webhook_without_name.events.all()
+    assert len(events) == 1
diff --git a/saleor/graphql/webhook/types.py b/saleor/graphql/webhook/types.py
index 0a6d0abb8c9..a14ba7b250c 100644
--- a/saleor/graphql/webhook/types.py
+++ b/saleor/graphql/webhook/types.py
@@ -147,7 +147,7 @@ class Meta:
 
 class Webhook(ModelObjectType[models.Webhook]):
     id = graphene.GlobalID(required=True)
-    name = graphene.String(required=True)
+    name = graphene.String(required=False)
     events = NonNullList(
         WebhookEvent,
         description="List of webhook events.",
diff --git a/saleor/tests/fixtures.py b/saleor/tests/fixtures.py
index 640f9296923..74655513184 100644
--- a/saleor/tests/fixtures.py
+++ b/saleor/tests/fixtures.py
@@ -6294,6 +6294,13 @@ def webhook(app):
     return webhook
 
 
+@pytest.fixture
+def webhook_without_name(app):
+    webhook = Webhook.objects.create(app=app, target_url="http://www.example.com/test")
+    webhook.events.create(event_type=WebhookEventAsyncType.ORDER_CREATED)
+    return webhook
+
+
 @pytest.fixture
 def any_webhook(app):
     webhook = Webhook.objects.create(

Bug: Cannot return null for non-nullable field Webhook.name.
### What are you trying to achieve?

Open app in dashboard.

It seems that name is optional https://docs.saleor.io/docs/3.x/api-reference/webhooks/inputs/webhook-create-input#code-style-fontweight-normal-webhookcreateinputbnamebcodestring-

But querying such webhooks would return error

### Steps to reproduce the problem

```graphql
mutation{
  webhookCreate(input:{targetUrl:"https://examples.site/", syncEvents:[SHIPPING_LIST_METHODS_FOR_CHECKOUT], app:"QXBwOjY5"}){
    errors{
      message
      field
    }
    webhook{
      name
    }
  }
}
```

```graphql
query App($id: ID!) {
  app(id: $id) {
    ...App
    aboutApp
    author
    permissions {
      code
      name
      __typename
    }
    dataPrivacy
    dataPrivacyUrl
    __typename
  }
}

fragment App on App {
  id
  name
  created
  isActive
  type
  homepageUrl
  appUrl
  manifestUrl
  configurationUrl
  supportUrl
  version
  accessToken
  privateMetadata {
    key
    value
    __typename
  }
  metadata {
    key
    value
    __typename
  }
  tokens {
    authToken
    id
    name
    __typename
  }
  webhooks {
    ...Webhook
    __typename
  }
  __typename
}

fragment Webhook on Webhook {
  id
  name
  isActive
  app {
    id
    name
    __typename
  }
  __typename
}
```

```
{
  "id": "QXBwOjY5",
  "PERMISSION_MANAGE_USERS": true,
  "PERMISSION_MANAGE_STAFF": true,
  "PERMISSION_IMPERSONATE_USER": true,
  "PERMISSION_MANAGE_APPS": true,
  "PERMISSION_MANAGE_OBSERVABILITY": true,
  "PERMISSION_MANAGE_CHECKOUTS": true,
  "PERMISSION_HANDLE_CHECKOUTS": true,
  "PERMISSION_HANDLE_TAXES": true,
  "PERMISSION_MANAGE_TAXES": true,
  "PERMISSION_MANAGE_CHANNELS": true,
  "PERMISSION_MANAGE_DISCOUNTS": true,
  "PERMISSION_MANAGE_GIFT_CARD": true,
  "PERMISSION_MANAGE_MENUS": true,
  "PERMISSION_MANAGE_ORDERS": true,
  "PERMISSION_MANAGE_PAGES": true,
  "PERMISSION_MANAGE_PAGE_TYPES_AND_ATTRIBUTES": true,
  "PERMISSION_HANDLE_PAYMENTS": true,
  "PERMISSION_MANAGE_PLUGINS": true,
  "PERMISSION_MANAGE_PRODUCTS": true,
  "PERMISSION_MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES": true,
  "PERMISSION_MANAGE_SHIPPING": true,
  "PERMISSION_MANAGE_SETTINGS": true,
  "PERMISSION_MANAGE_TRANSLATIONS": true
}
```

```
{
  "errors": [
    {
      "message": "Cannot return null for non-nullable field Webhook.name.",
      "locations": [
        {
          "line": 55,
          "column": 3
        }
      ],
      "path": [
        "app",
        "webhooks",
        1,
        "name"
      ],
      "extensions": {
        "exception": {
          "code": "GraphQLError"
        }
      }
    }
  ],
  "data": {
    "app": {
      "id": "QXBwOjY5",
      "name": "Manage products",
      "created": "2023-03-27T15:39:57.879720+00:00",
      "isActive": true,
      "type": "LOCAL",
      "homepageUrl": null,
      "appUrl": null,
      "manifestUrl": null,
      "configurationUrl": null,
      "supportUrl": null,
      "version": null,
      "accessToken": null,
      "privateMetadata": [],
      "metadata": [],
      "tokens": [
        {
          "authToken": "Myd1",
          "id": "QXBwVG9rZW46Njk=",
          "name": "Default",
          "__typename": "AppToken"
        },
        {
          "authToken": "Dpqk",
          "id": "QXBwVG9rZW46NzA=",
          "name": "manage",
          "__typename": "AppToken"
        }
      ],
      "webhooks": null,
      "__typename": "App",
      "aboutApp": null,
      "author": null,
      "permissions": [
        {
          "code": "HANDLE_CHECKOUTS",
          "name": "Handle checkouts",
          "__typename": "Permission"
        },
        {
          "code": "HANDLE_PAYMENTS",
          "name": "Handle payments",
          "__typename": "Permission"
        },
        {
          "code": "HANDLE_TAXES",
          "name": "Handle taxes",
          "__typename": "Permission"
        },
        {
          "code": "IMPERSONATE_USER",
          "name": "Impersonate user.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_APPS",
          "name": "Manage apps",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_CHANNELS",
          "name": "Manage channels.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_CHECKOUTS",
          "name": "Manage checkouts",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_DISCOUNTS",
          "name": "Manage sales and vouchers.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_GIFT_CARD",
          "name": "Manage gift cards.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_MENUS",
          "name": "Manage navigation.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_OBSERVABILITY",
          "name": "Manage observability",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_ORDERS",
          "name": "Manage orders.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_PAGES",
          "name": "Manage pages.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_PAGE_TYPES_AND_ATTRIBUTES",
          "name": "Manage page types and attributes.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_PLUGINS",
          "name": "Manage plugins",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_PRODUCTS",
          "name": "Manage products.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES",
          "name": "Manage product types and attributes.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_SETTINGS",
          "name": "Manage settings.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_SHIPPING",
          "name": "Manage shipping.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_STAFF",
          "name": "Manage staff.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_TAXES",
          "name": "Manage taxes",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_TRANSLATIONS",
          "name": "Manage translations.",
          "__typename": "Permission"
        },
        {
          "code": "MANAGE_USERS",
          "name": "Manage customers.",
          "__typename": "Permission"
        }
      ],
      "dataPrivacy": null,
      "dataPrivacyUrl": null
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 3,
      "maximumAvailable": 50000
    }
  }
}
```

### What did you expect to happen?

Return null

### Logs

_No response_

### Environment

Saleor version: 3.13

