Skip to content

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

Drop deprecated meta mutations (#6422)

Marcin Gębala7e685b3366cc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 94a31552de..0cb7377947 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,8 @@ All notable, unreleased changes to this project will be documented in this file.
## [Unreleased]
-- Add metadata to shipping zones and shipping methods - by @maarcingebala #6340
+- Add metadata to shipping zones and shipping methods - #6340 by @maarcingebala
+- Drop deprecated meta mutations - #6422 by @maarcingebala
## 2.11.0
diff --git a/saleor/graphql/account/deprecated/mutations_service_account.py b/saleor/graphql/account/deprecated/mutations_service_account.py
index caace1f621..2044f9d487 100644
--- a/saleor/graphql/account/deprecated/mutations_service_account.py
+++ b/saleor/graphql/account/deprecated/mutations_service_account.py
@@ -8,7 +8,6 @@ from ...account.utils import can_manage_app, get_out_of_scope_permissions
from ...core.enums import PermissionEnum
from ...core.mutations import ModelDeleteMutation, ModelMutation
from ...core.types.common import AccountError
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ...utils import get_user_or_app_from_context, requestor_is_superuser
from .types import ServiceAccount, ServiceAccountToken
@@ -236,25 +235,3 @@ class ServiceAccountDelete(ModelDeleteMutation):
@classmethod
def get_type_for_model(cls):
return ServiceAccount
-
-
-class ServiceAccountUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- return_field_name = "serviceAccount"
- description = "Updates private metadata for a service account."
- permissions = (AppPermission.MANAGE_APPS,)
- model = models.App
- public = False
- error_type_class = AccountError
- error_type_field = "account_errors"
-
-
-class ServiceAccountClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- return_field_name = "serviceAccount"
- description = "Clear private metadata for a service account."
- model = models.App
- permissions = (AppPermission.MANAGE_APPS,)
- public = False
- error_type_class = AccountError
- error_type_field = "account_errors"
diff --git a/saleor/graphql/account/deprecated/types.py b/saleor/graphql/account/deprecated/types.py
index 1192b15a6e..5d8fa63189 100644
--- a/saleor/graphql/account/deprecated/types.py
+++ b/saleor/graphql/account/deprecated/types.py
@@ -5,7 +5,6 @@ from ....app.models import App, AppToken
from ....core.permissions import AppPermission
from ...core.connection import CountableDjangoObjectType
from ...core.types import FilterInputObjectType, Permission
-from ...meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ...meta.types import ObjectWithMetadata
from ...utils import format_permissions_for_display
from .filters import ServiceAccountFilter
@@ -75,14 +74,6 @@ class ServiceAccount(CountableDjangoObjectType):
def resolve_tokens(root: App, _info, **_kwargs):
return root.tokens.all() # type: ignore
- @staticmethod
- def resolve_meta(root: App, info):
- return resolve_meta(root, info)
-
- @staticmethod
- def resolve_private_meta(root: App, _info):
- return resolve_private_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.py
index 7418c4883f..1ab7b09598 100644
--- a/saleor/graphql/account/mutations/account.py
+++ b/saleor/graphql/account/mutations/account.py
@@ -15,8 +15,6 @@ from ...account.enums import AddressTypeEnum
from ...account.types import Address, AddressInput, User
from ...core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation
from ...core.types.common import AccountError
-from ...meta.deprecated.mutations import UpdateMetaBaseMutation
-from ...meta.deprecated.types import MetaInput
from ..i18n import I18nMixin
from .base import (
INVALID_TOKEN,
@@ -334,29 +332,6 @@ class AccountSetDefaultAddress(BaseMutation):
return cls(user=user)
-class AccountUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates metadata of the logged-in user."
- model = models.User
- public = True
- error_type_class = AccountError
- error_type_field = "account_errors"
-
- class Arguments:
- input = MetaInput(
- description="Fields required to update new or stored metadata item.",
- required=True,
- )
-
- @classmethod
- def check_permissions(cls, context):
- return context.user.is_authenticated
-
- @classmethod
- def get_instance(cls, info, **data):
- return info.context.user
-
-
class RequestEmailChange(BaseMutation):
user = graphene.Field(User, description="A user instance.")
diff --git a/saleor/graphql/account/mutations/base.py b/saleor/graphql/account/mutations/base.py
index 190821c8ae..f202684e55 100644
--- a/saleor/graphql/account/mutations/base.py
+++ b/saleor/graphql/account/mutations/base.py
@@ -23,7 +23,6 @@ from ...core.mutations import (
validation_error_to_error_type,
)
from ...core.types.common import AccountError
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from .jwt import CreateToken
BILLING_ADDRESS_FIELD = "default_billing_address"
@@ -431,23 +430,3 @@ class BaseCustomerCreate(ModelMutation, I18nMixin):
send_set_password_email_with_url(
cleaned_input.get("redirect_url"), instance
)
-
-
-class UserUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates metadata for user."
- model = models.User
- public = True
- error_type_class = AccountError
- error_type_field = "account_errors"
- permissions = (AccountPermissions.MANAGE_USERS,)
-
-
-class UserClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clear metadata for user."
- model = models.User
- public = True
- error_type_class = AccountError
- error_type_field = "account_errors"
- permissions = (AccountPermissions.MANAGE_USERS,)
diff --git a/saleor/graphql/account/mutations/staff.py b/saleor/graphql/account/mutations/staff.py
index 8903764938..68d5166ae7 100644
--- a/saleor/graphql/account/mutations/staff.py
+++ b/saleor/graphql/account/mutations/staff.py
@@ -21,7 +21,6 @@ from ...core.types import Upload
from ...core.types.common import AccountError, StaffError
from ...core.utils import get_duplicates_ids, validate_image_file
from ...decorators import staff_member_required
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ..utils import (
CustomerDeleteMixin,
StaffDeleteMixin,
@@ -564,23 +563,3 @@ class UserAvatarDelete(BaseMutation):
user.avatar.delete_sized_images()
user.avatar.delete()
return UserAvatarDelete(user=user)
-
-
-class UserUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates private metadata for user."
- permissions = (AccountPermissions.MANAGE_USERS,)
- model = models.User
- public = False
- error_type_class = AccountError
- error_type_field = "account_errors"
-
-
-class UserClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clear private metadata for user."
- model = models.User
- permissions = (AccountPermissions.MANAGE_USERS,)
- public = False
- error_type_class = AccountError
- error_type_field = "account_errors"
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py
index 3b54c381e5..4bb02353b3 100644
--- a/saleor/graphql/account/schema.py
+++ b/saleor/graphql/account/schema.py
@@ -6,13 +6,11 @@ from ..core.types import FilterInputObjectType
from ..decorators import one_of_permissions_required, permission_required
from .bulk_mutations import CustomerBulkDelete, StaffBulkDelete, UserBulkSetActive
from .deprecated.mutations_service_account import (
- ServiceAccountClearPrivateMeta,
ServiceAccountCreate,
ServiceAccountDelete,
ServiceAccountTokenCreate,
ServiceAccountTokenDelete,
ServiceAccountUpdate,
- ServiceAccountUpdatePrivateMeta,
)
from .deprecated.resolvers import resolve_service_accounts
from .deprecated.sorters import ServiceAccountSortingInput
@@ -28,7 +26,6 @@ from .mutations.account import (
AccountRequestDeletion,
AccountSetDefaultAddress,
AccountUpdate,
- AccountUpdateMeta,
ConfirmEmailChange,
RequestEmailChange,
)
@@ -37,8 +34,6 @@ from .mutations.base import (
PasswordChange,
RequestPasswordReset,
SetPassword,
- UserClearMeta,
- UserUpdateMeta,
)
from .mutations.jwt import (
CreateToken,
@@ -64,8 +59,6 @@ from .mutations.staff import (
StaffUpdate,
UserAvatarDelete,
UserAvatarUpdate,
- UserClearPrivateMeta,
- UserUpdatePrivateMeta,
)
from .resolvers import (
resolve_address,
@@ -248,13 +241,6 @@ class AccountMutations(graphene.ObjectType):
account_request_deletion = AccountRequestDeletion.Field()
account_delete = AccountDelete.Field()
- account_update_meta = AccountUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation. This field will be removed after "
- "2020-07-31."
- )
- )
-
# Staff mutations
address_create = AddressCreate.Field()
address_update = AddressUpdate.Field()
@@ -275,32 +261,6 @@ class AccountMutations(graphene.ObjectType):
user_avatar_delete = UserAvatarDelete.Field()
user_bulk_set_active = UserBulkSetActive.Field()
- user_update_metadata = UserUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation. This field will be removed after "
- "2020-07-31."
- )
- )
- user_clear_metadata = UserClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation. This field will be removed after "
- "2020-07-31."
- )
- )
-
- user_update_private_metadata = UserUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation. This field will be removed "
- "after 2020-07-31."
- )
- )
- user_clear_private_metadata = UserClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation. This field will be removed "
- "after 2020-07-31."
- )
- )
-
service_account_create = ServiceAccountCreate.Field(
deprecation_reason=(
"Use the `appCreate` mutation instead. This field will be removed after "
@@ -319,20 +279,6 @@ class AccountMutations(graphene.ObjectType):
"2020-07-31."
)
)
-
- service_account_update_private_metadata = ServiceAccountUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation with App instead."
- "This field will be removed after 2020-07-31."
- )
- )
- service_account_clear_private_metadata = ServiceAccountClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation with App instead."
- "This field will be removed after 2020-07-31."
- )
- )
-
service_account_token_create = ServiceAccountTokenCreate.Field(
deprecation_reason=(
"Use the `appTokenCreate` mutation instead. This field will be removed "
diff --git a/saleor/graphql/account/tests/test_account_meta.py b/saleor/graphql/account/tests/test_account_meta.py
deleted file mode 100644
index 7f11f3a822..0000000000
--- a/saleor/graphql/account/tests/test_account_meta.py
+++ /dev/null
@@ -1,491 +0,0 @@
-# Deprecated we should remove it in #5221
-import json
-
-import graphene
-import pytest
-
-from ...tests.utils import assert_no_permission, get_graphql_content
-
-PRIVATE_META_NAMESPACE = ""
-PUBLIC_META_NAMESPACE = ""
-
-
-META_CLIENT = ""
-
-PRIVATE_KEY = "name"
-PRIVATE_VALUE = "Bond"
-
-PUBLIC_KEY = "purpose"
-PUBLIC_VALUE = "42"
-
-
-def customer_with_meta(customer_user):
- customer_user.store_value_in_private_metadata(items={PRIVATE_KEY: PRIVATE_VALUE})
- customer_user.store_value_in_metadata(items={PUBLIC_KEY: PUBLIC_VALUE})
- customer_user.save()
- return customer_user
-
-
-GET_PRIVATE_META_QUERY = """
- query UserMeta($id: ID!) {
- user(id: $id) {
- email
- privateMeta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
-"""
-
-
-def test_get_private_meta(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {"id": user_id}
- response = staff_api_client.post_graphql(
- GET_PRIVATE_META_QUERY, variables, permissions=[permission_manage_users]
- )
- meta = get_graphql_content(response)["data"]["user"]["privateMeta"][0]
-
- assert meta["namespace"] == PRIVATE_META_NAMESPACE
- assert meta["clients"] == [
- {
- "metadata": [{"key": PRIVATE_KEY, "value": PRIVATE_VALUE}],
- "name": META_CLIENT,
- }
- ]
-
-
-MY_PRIVATE_META_QUERY = """
- {
- me {
- email
- privateMeta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
-"""
-
-
-def test_user_has_no_access_to_private_meta(user_api_client, customer_with_meta):
- response = user_api_client.post_graphql(MY_PRIVATE_META_QUERY)
- data = json.loads(response.content.decode("utf8"))
- assert data["errors"] is not None
- assert data["data"]["me"] is None
-
-
-UPDATE_PRIVATE_METADATA_MUTATION = """
- mutation UserUpdatePrivateMetadata($id: ID!, $input: MetaInput!) {
- userUpdatePrivateMetadata(
- id: $id
- input: $input
- ) {
- user {
- privateMeta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
- }
-"""
-
-
-def test_update_private_metadata_through_mutation(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- NEW_VALUE = "NEW_VALUE"
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PRIVATE_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PRIVATE_KEY,
- "value": NEW_VALUE,
- },
- }
- response = staff_api_client.post_graphql(
- UPDATE_PRIVATE_METADATA_MUTATION,
- variables,
- permissions=[permission_manage_users],
- )
- meta = get_graphql_content(response)["data"]["userUpdatePrivateMetadata"]["user"][
- "privateMeta"
- ][0]
-
- assert meta["namespace"] == PRIVATE_META_NAMESPACE
- assert meta["clients"] == [
- {"metadata": [{"key": PRIVATE_KEY, "value": NEW_VALUE}], "name": META_CLIENT}
- ]
-
-
-def test_add_new_key_value_pair_to_private_metadata_using_mutation(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- NEW_KEY = "NEW_KEY"
- NEW_VALUE = "NEW_VALUE"
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PRIVATE_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": NEW_KEY,
- "value": NEW_VALUE,
- },
- }
- response = staff_api_client.post_graphql(
- UPDATE_PRIVATE_METADATA_MUTATION,
- variables,
- permissions=[permission_manage_users],
- )
- meta = get_graphql_content(response)["data"]["userUpdatePrivateMetadata"]["user"][
- "privateMeta"
- ][0]
-
- expected_metadata = [
- {"key": NEW_KEY, "value": NEW_VALUE},
- {"key": PRIVATE_KEY, "value": PRIVATE_VALUE},
- ]
- assert meta["namespace"] == PRIVATE_META_NAMESPACE
- assert meta["clients"] == [{"metadata": expected_metadata, "name": META_CLIENT}]
-
-
-CLEAR_PRIVATE_METADATA_MUTATION = """
- mutation UserClearPrivateMetadata($id: ID!, $input: MetaPath!) {
- userClearPrivateMetadata(
- id: $id
- input: $input
- ) {
- user {
- privateMeta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
- }
-"""
-
-
-def test_clear_private_metadata_through_mutation(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PRIVATE_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PRIVATE_KEY,
- },
- }
- response = staff_api_client.post_graphql(
- CLEAR_PRIVATE_METADATA_MUTATION,
- variables,
- permissions=[permission_manage_users],
- )
- meta = get_graphql_content(response)["data"]["userClearPrivateMetadata"]["user"][
- "privateMeta"
- ][0]
-
- assert meta["namespace"] == PRIVATE_META_NAMESPACE
- assert meta["clients"] == []
-
-
-MY_PUBLIC_META_QUERY = """
- {
- me {
- email
- meta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
-"""
-
-
-def test_access_users_public_metadata(user_api_client, customer_with_meta):
- response = user_api_client.post_graphql(MY_PUBLIC_META_QUERY)
- data = json.loads(response.content.decode("utf8"))
- assert "errors" not in data
-
- meta = get_graphql_content(response)["data"]["me"]["meta"][0]
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == [
- {"metadata": [{"key": PUBLIC_KEY, "value": PUBLIC_VALUE}], "name": META_CLIENT}
- ]
-
-
-GET_META_QUERY = """
- query UserMeta($id: ID!) {
- user(id: $id) {
- email
- meta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
-"""
-
-
-def test_staff_access_to_public_metadata(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {"id": user_id}
- response = staff_api_client.post_graphql(
- GET_META_QUERY, variables, permissions=[permission_manage_users]
- )
- meta = get_graphql_content(response)["data"]["user"]["meta"][0]
-
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == [
- {"metadata": [{"key": PUBLIC_KEY, "value": PUBLIC_VALUE}], "name": META_CLIENT}
- ]
-
-
-UPDATE_METADATA_MUTATION = """
- mutation UserUpdateMetadata($id: ID!, $input: MetaInput!) {
- userUpdateMetadata(
- id: $id
- input: $input
- ) {
- user {
- meta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
- }
-"""
-
-
-def test_staff_update_metadata_through_mutation(
- staff_api_client, permission_manage_users, customer_with_meta
-):
- NEW_VALUE = "NEW_VALUE"
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PUBLIC_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PUBLIC_KEY,
- "value": NEW_VALUE,
- },
- }
-
- resp = staff_api_client.post_graphql(
- UPDATE_METADATA_MUTATION, variables, permissions=[permission_manage_users]
- )
- meta = get_graphql_content(resp)["data"]["userUpdateMetadata"]["user"]["meta"][0]
-
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == [
- {"metadata": [{"key": PUBLIC_KEY, "value": NEW_VALUE}], "name": META_CLIENT}
- ]
-
-
-def test_staff_add_new_key_value_pair_to_metadata_using_mutation(
- staff_api_client, customer_with_meta, permission_manage_users
-):
- NEW_KEY = "NEW_KEY"
- NEW_VALUE = "NEW_VALUE"
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PUBLIC_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": NEW_KEY,
- "value": NEW_VALUE,
- },
- }
- response = staff_api_client.post_graphql(
- UPDATE_METADATA_MUTATION, variables, permissions=[permission_manage_users]
- )
- meta = get_graphql_content(response)["data"]["userUpdateMetadata"]["user"]["meta"][
- 0
- ]
-
- expected_metadata = [
- {"key": NEW_KEY, "value": NEW_VALUE},
- {"key": PUBLIC_KEY, "value": PUBLIC_VALUE},
- ]
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == [{"metadata": expected_metadata, "name": META_CLIENT}]
-
-
-CLEAR_METADATA_MUTATION = """
- mutation UserClearPrivateMetadata($id: ID!, $input: MetaPath!) {
- userClearMetadata(
- id: $id
- input: $input
- ) {
- user {
- meta {
- namespace
- clients {
- name
- metadata {
- key
- value
- }
- }
- }
- }
- }
- }
-"""
-
-
-def test_staff_clear_metadata_through_mutation(
- staff_api_client, customer_with_meta, permission_manage_users
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PUBLIC_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PUBLIC_KEY,
- },
- }
- response = staff_api_client.post_graphql(
- CLEAR_METADATA_MUTATION, variables, permissions=[permission_manage_users]
- )
- meta = get_graphql_content(response)["data"]["userClearMetadata"]["user"]["meta"][0]
-
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == []
-
-
- "mutation", [UPDATE_METADATA_MUTATION, UPDATE_PRIVATE_METADATA_MUTATION]
-)
-def test_staff_update_meta_without_permissions(
- staff_api_client, customer_with_meta, mutation
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": "new_namespace",
- "clientName": "client_name",
- "key": "meta_key",
- "value": "value",
- },
- }
- response = staff_api_client.post_graphql(mutation, variables)
- assert_no_permission(response)
-
-
- "mutation", [CLEAR_METADATA_MUTATION, CLEAR_PRIVATE_METADATA_MUTATION]
-)
-def test_staff_clear_meta_without_permissions(
- staff_api_client, customer_with_meta, mutation
-):
- user_id = graphene.Node.to_global_id("User", customer_with_meta.id)
- variables = {
- "id": user_id,
- "input": {
- "namespace": PUBLIC_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PUBLIC_KEY,
- },
- }
- response = staff_api_client.post_graphql(mutation, variables)
- assert_no_permission(response)
-
-
-UPDATE_ACCOUNT_META_MUTATION = """
- mutation AccountUpdateMeta($input: MetaInput!) {
- accountUpdateMeta(input: $input){
- user{
- meta{
- namespace
- clients{
- name
- metadata{
- key
- value
- }
- }
- }
- }
- }
- }
-"""
-
-
-def test_user_updates_own_meta(user_api_client, customer_with_meta):
- NEW_VALUE = "NEW_VALUE"
- variables = {
- "input": {
- "namespace": PUBLIC_META_NAMESPACE,
- "clientName": META_CLIENT,
- "key": PUBLIC_KEY,
- "value": NEW_VALUE,
- }
- }
-
- resp = user_api_client.post_graphql(UPDATE_ACCOUNT_META_MUTATION, variables)
- meta = get_graphql_content(resp)["data"]["accountUpdateMeta"]["user"]["meta"][0]
-
- assert meta["namespace"] == PUBLIC_META_NAMESPACE
- assert meta["clients"] == [
- {"metadata": [{"key": PUBLIC_KEY, "value": NEW_VALUE}], "name": META_CLIENT}
- ]
diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.py
index 11187b5122..cc7dedb197 100644
--- a/saleor/graphql/account/types.py
+++ b/saleor/graphql/account/types.py
@@ -14,7 +14,6 @@ from ..core.fields import PrefetchingConnectionField
from ..core.types import CountryDisplay, Image, Permission
from ..core.utils import from_global_id_strict_type
from ..decorators import one_of_permissions_required, permission_required
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..utils import format_permissions_for_display
from ..wishlist.resolvers import resolve_wishlist_items_from_user
@@ -320,17 +319,6 @@ class User(CountableDjangoObjectType):
return resolve_payment_sources(root)
raise PermissionDenied()
- @staticmethod
- @one_of_permissions_required(
- [AccountPermissions.MANAGE_USERS, AccountPermissions.MANAGE_STAFF]
- )
- def resolve_private_meta(root: models.User, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.User, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def resolve_wishlist(root: models.User, info, **_kwargs):
return resolve_wishlist_items_from_user(root)
diff --git a/saleor/graphql/app/types.py b/saleor/graphql/app/types.py
index 2a71855e53..bce3a39e3e 100644
--- a/saleor/graphql/app/types.py
+++ b/saleor/graphql/app/types.py
@@ -6,7 +6,6 @@ from ...core.permissions import AppPermission
from ..core.connection import CountableDjangoObjectType
from ..core.types import Permission
from ..core.types.common import Job
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..utils import format_permissions_for_display
from ..webhook.types import Webhook
@@ -111,14 +110,6 @@ class App(CountableDjangoObjectType):
def resolve_tokens(root: models.App, _info, **_kwargs):
return root.tokens.all() # type: ignore
- @staticmethod
- def resolve_meta(root: models.App, info):
- return resolve_meta(root, info)
-
- @staticmethod
- def resolve_private_meta(root: models.App, _info):
- return resolve_private_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.py
index 848fdc8d32..e6b4a9e349 100644
--- a/saleor/graphql/checkout/mutations.py
+++ b/saleor/graphql/checkout/mutations.py
@@ -21,7 +21,6 @@ from ...checkout.utils import (
)
from ...core import analytics
from ...core.exceptions import InsufficientStock, PermissionDenied, ProductNotPublished
-from ...core.permissions import OrderPermissions
from ...core.transactions import transaction_with_commit_on_errors
from ...order import models as order_models
from ...payment import models as payment_models
@@ -32,7 +31,6 @@ from ..account.types import AddressInput
from ..core.mutations import BaseMutation, ModelMutation
from ..core.types.common import CheckoutError
from ..core.utils import from_global_id_strict_type
-from ..meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ..order.types import Order
from ..product.types import ProductVariant
from ..shipping.types import ShippingMethod
@@ -897,43 +895,3 @@ class CheckoutRemovePromoCode(BaseMutation):
remove_promo_code_from_checkout(checkout, promo_code)
info.context.plugins.checkout_updated(checkout)
return CheckoutRemovePromoCode(checkout=checkout)
-
-
-class CheckoutUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates metadata for checkout."
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- model = models.Checkout
- public = True
- error_type_class = CheckoutError
- error_type_field = "checkout_errors"
-
-
-class CheckoutUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates private metadata for checkout."
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- model = models.Checkout
- public = False
- error_type_class = CheckoutError
- error_type_field = "checkout_errors"
-
-
-class CheckoutClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clear metadata for checkout."
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- model = models.Checkout
- public = True
- error_type_class = CheckoutError
- error_type_field = "checkout_errors"
-
-
-class CheckoutClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clear private metadata for checkout."
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- model = models.Checkout
- public = False
- error_type_class = CheckoutError
- error_type_field = "checkout_errors"
diff --git a/saleor/graphql/checkout/schema.py b/saleor/graphql/checkout/schema.py
index 4d49e06382..3848c2480d 100644
--- a/saleor/graphql/checkout/schema.py
+++ b/saleor/graphql/checkout/schema.py
@@ -8,8 +8,6 @@ from ..payment.mutations import CheckoutPaymentCreate
from .mutations import (
CheckoutAddPromoCode,
CheckoutBillingAddressUpdate,
- CheckoutClearMeta,
- CheckoutClearPrivateMeta,
CheckoutComplete,
CheckoutCreate,
CheckoutCustomerAttach,
@@ -21,8 +19,6 @@ from .mutations import (
CheckoutRemovePromoCode,
CheckoutShippingAddressUpdate,
CheckoutShippingMethodUpdate,
- CheckoutUpdateMeta,
- CheckoutUpdatePrivateMeta,
)
from .resolvers import resolve_checkout, resolve_checkout_lines, resolve_checkouts
from .types import Checkout, CheckoutLine
@@ -75,27 +71,3 @@ class CheckoutMutations(graphene.ObjectType):
checkout_payment_create = CheckoutPaymentCreate.Field()
checkout_shipping_address_update = CheckoutShippingAddressUpdate.Field()
checkout_shipping_method_update = CheckoutShippingMethodUpdate.Field()
- checkout_update_metadata = CheckoutUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation. This field will be removed after "
- "2020-07-31."
- )
- )
- checkout_clear_metadata = CheckoutClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation. This field will be removed after "
- "2020-07-31."
- )
- )
- checkout_update_private_metadata = CheckoutUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation. This field will be removed "
- "after 2020-07-31."
- )
- )
- checkout_clear_private_metadata = CheckoutClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation. This field will be removed "
- "after 2020-07-31."
- )
- )
diff --git a/saleor/graphql/checkout/types.py b/saleor/graphql/checkout/types.py
index a47a058bab..8c59ce1f45 100644
--- a/saleor/graphql/checkout/types.py
+++ b/saleor/graphql/checkout/types.py
@@ -4,17 +4,15 @@ from promise import Promise
from ...checkout import calculations, models
from ...checkout.utils import get_valid_shipping_methods_for_checkout
from ...core.exceptions import PermissionDenied
-from ...core.permissions import AccountPermissions, CheckoutPermissions
+from ...core.permissions import AccountPermissions
from ...core.taxes import display_gross_prices, zero_taxed_money
from ...plugins.manager import get_plugins_manager
from ..account.utils import requestor_has_access
from ..core.connection import CountableDjangoObjectType
from ..core.scalars import UUID
from ..core.types.money import TaxedMoney
-from ..decorators import permission_required
from ..discount.dataloaders import DiscountsByDateTimeLoader
from ..giftcard.types import GiftCard
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..shipping.types import ShippingMethod
from ..utils import get_user_or_app_from_context
@@ -254,12 +252,3 @@ class Checkout(CountableDjangoObjectType):
@staticmethod
def resolve_is_shipping_required(root: models.Checkout, _info):
return root.is_shipping_required()
-
- @staticmethod
- @permission_required(CheckoutPermissions.MANAGE_CHECKOUTS)
- def resolve_private_meta(root: models.Checkout, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Checkout, _info):
- return resolve_meta(root, _info)
diff --git a/saleor/graphql/meta/deprecated/__init__.py b/saleor/graphql/meta/deprecated/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/saleor/graphql/meta/deprecated/mutations.py b/saleor/graphql/meta/deprecated/mutations.py
deleted file mode 100644
index e2a96235a2..0000000000
--- a/saleor/graphql/meta/deprecated/mutations.py
+++ /dev/null
@@ -1,143 +0,0 @@
-# Deprecated we should remove it in #5221
-import graphene
-from django.core.exceptions import ImproperlyConfigured
-from graphene_django.registry import get_global_registry
-
-from ...core.mutations import BaseMutation, get_model_name
-from .types import MetaInput, MetaPath
-
-registry = get_global_registry()
-
-
-def get_output_fields(model, return_field_name):
- """Return mutation output field for model instance."""
- model_type = registry.get_type_for_model(model)
- if not model_type:
- raise ImproperlyConfigured(
- "Unable to find type for model %s in graphene registry" % model.__name__
- )
- fields = {return_field_name: graphene.Field(model_type)}
- return fields
-
-
-class MetaUpdateOptions(graphene.types.mutation.MutationOptions):
- model = None
- return_field_name = None
- public = False
-
-
-class BaseMetadataMutation(BaseMutation):
- class Meta:
- abstract = True
-
- @classmethod
- def __init_subclass_with_meta__(
- cls,
- arguments=None,
- model=None,
- public=False,
- return_field_name=None,
- _meta=None,
- **kwargs,
- ):
- if not model:
- raise ImproperlyConfigured("model is required for update meta mutation")
- if not _meta:
- _meta = MetaUpdateOptions(cls)
- if not arguments:
- arguments = {}
- if not return_field_name:
- return_field_name = get_model_name(model)
- fields = get_output_fields(model, return_field_name)
-
- _meta.model = model
- _meta.public = public
- _meta.return_field_name = return_field_name
-
- super().__init_subclass_with_meta__(_meta=_meta, **kwargs)
- cls._update_mutation_arguments_and_fields(arguments=arguments, fields=fields)
-
- @classmethod
- def get_store_method(cls, instance):
- return (
- getattr(instance, "store_value_in_metadata")
- if cls._meta.public
- else getattr(instance, "store_value_in_private_metadata")
- )
-
- @classmethod
- def get_meta_method(cls, instance):
- return (
- getattr(instance, "get_value_from_metadata")
- if cls._meta.public
- else getattr(instance, "get_value_from_private_metadata")
- )
-
- @classmethod
- def get_delete_method(cls, instance):
- return (
- getattr(instance, "delete_value_from_metadata")
- if cls._meta.public
- else getattr(instance, "delete_value_from_private_metadata")
- )
-
- @classmethod
- def get_instance(cls, info, **data):
- object_id = data.get("id")
- if object_id:
- model_type = registry.get_type_for_model(cls._meta.model)
- instance = cls.get_node_or_error(info, object_id, only_type=model_type)
- else:
- instance = cls._meta.model()
- return instance
-
- @classmethod
- def success_response(cls, instance):
- """Return a success response."""
- return cls(**{cls._meta.return_field_name: instance, "errors": []})
-
-
-class UpdateMetaBaseMutation(BaseMetadataMutation):
- class Meta:
- abstract = True
-
- class Arguments:
- id = graphene.ID(description="ID of an object to update.", required=True)
- input = MetaInput(
- description="Fields required to update new or stored metadata item.",
- required=True,
- )
-
- @classmethod
- def perform_mutation(cls, root, info, **data):
- instance = cls.get_instance(info, **data)
- store_meta = cls.get_store_method(instance)
-
- metadata = data.pop("input")
- store_meta(items={metadata.key: metadata.value})
- instance.save()
- return cls.success_response(instance)
-
-
-class ClearMetaBaseMutation(BaseMetadataMutation):
- class Meta:
- abstract = True
-
- class Arguments:
- id = graphene.ID(description="ID of a customer to update.", required=True)
- input = MetaPath(
- description="Fields required to identify stored metadata item.",
- required=True,
- )
-
- @classmethod
- def perform_mutation(cls, root, info, **data):
- instance = cls.get_instance(info, **data)
- delete_meta = cls.get_delete_method(instance)
-
- metadata = data.pop("input")
-
- delete_meta(metadata.key)
- instance.save()
-
- return cls.success_response(instance)
diff --git a/saleor/graphql/meta/deprecated/resolvers.py b/saleor/graphql/meta/deprecated/resolvers.py
deleted file mode 100644
index 357df32e8a..0000000000
--- a/saleor/graphql/meta/deprecated/resolvers.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Deprecated we should remove it in #5221
-def resolve_private_meta(root, _info):
- return [root.private_metadata]
-
-
-def resolve_meta(root, _info):
- return [root.metadata]
diff --git a/saleor/graphql/meta/deprecated/types.py b/saleor/graphql/meta/deprecated/types.py
deleted file mode 100644
index 678e1d31e3..0000000000
--- a/saleor/graphql/meta/deprecated/types.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Deprecated we should remove it in #5221
-import graphene
-
-from ..resolvers import resolve_metadata
-
-
-class MetaItem(graphene.ObjectType):
- key = graphene.String(required=True, description="Key of a metadata item.")
- value = graphene.String(required=True, description="Value of a metadata item.")
-
-
-class MetaPath(graphene.InputObjectType):
- namespace = graphene.String(
- required=True, description="Name of metadata client group.",
- )
- client_name = graphene.String(required=True, description="Metadata client's name.",)
- key = graphene.String(required=True, description="Key for stored data.")
-
-
-class MetaInput(MetaPath):
- value = graphene.String(required=True, description="Stored metadata value.")
-
-
-class MetaClientStore(graphene.ObjectType):
- name = graphene.String(required=True, description="Metadata client's name.")
- metadata = graphene.List(
- MetaItem, required=True, description="Metadata stored for a client."
- )
-
- @staticmethod
- def resolve_metadata(root, _info):
- return resolve_metadata(root)
-
- @staticmethod
- def resolve_name(_root, _info):
- return ""
-
-
-class MetaStore(graphene.ObjectType):
- namespace = graphene.String(
- required=True, description="Name of metadata client group."
- )
- clients = graphene.List(
- MetaClientStore,
- required=True,
- description="List of clients that stored metadata in a group.",
- )
-
- @staticmethod
- def resolve_clients(root: dict, _info):
- if root:
- return [root]
- return []
-
- @staticmethod
- def resolve_namespace(_root, _info):
- return ""
diff --git a/saleor/graphql/meta/types.py b/saleor/graphql/meta/types.py
index 7b6d6ebd7f..cc525a0ca8 100644
--- a/saleor/graphql/meta/types.py
+++ b/saleor/graphql/meta/types.py
@@ -30,25 +30,6 @@ class ObjectWithMetadata(graphene.Interface):
),
)
- # Deprecated we should remove it in #5221
- private_meta = graphene.List(
- "saleor.graphql.meta.deprecated.types.MetaStore",
- required=True,
- description="List of privately stored metadata namespaces.",
- deprecation_reason=(
- "Use the `privetaMetadata` field. This field will be removed after "
- "2020-07-31."
- ),
- )
- meta = graphene.List(
- "saleor.graphql.meta.deprecated.types.MetaStore",
- required=True,
- description="List of publicly stored metadata namespaces.",
- deprecation_reason=(
- "Use the `metadata` field. This field will be removed after 2020-07-31."
- ),
- )
-
@staticmethod
def resolve_metadata(root: ModelWithMetadata, _info):
return resolve_metadata(root.metadata)
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.py
index edd1dbc337..88dfe40298 100644
--- a/saleor/graphql/order/mutations/fulfillments.py
+++ b/saleor/graphql/order/mutations/fulfillments.py
@@ -6,7 +6,6 @@ from django.template.defaultfilters import pluralize
from ....core.exceptions import InsufficientStock
from ....core.permissions import OrderPermissions
-from ....order import models
from ....order.actions import (
cancel_fulfillment,
create_fulfillments,
@@ -17,7 +16,6 @@ from ....order.error_codes import OrderErrorCode
from ...core.mutations import BaseMutation
from ...core.types.common import OrderError
from ...core.utils import from_global_id_strict_type, get_duplicated_values
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ...order.types import Fulfillment, Order
from ...warehouse.types import Warehouse
from ..types import OrderLine
@@ -70,38 +68,6 @@ class FulfillmentCancelInput(graphene.InputObjectType):
)
-class FulfillmentClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears metadata for fulfillment."
- model = models.Fulfillment
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = True
-
-
-class FulfillmentUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates metadata for fulfillment."
- model = models.Fulfillment
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = True
-
-
-class FulfillmentClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears private metadata for fulfillment."
- model = models.Fulfillment
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = False
-
-
-class FulfillmentUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates metadata for fulfillment."
- model = models.Fulfillment
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = False
-
-
class OrderFulfill(BaseMutation):
fulfillments = graphene.List(
Fulfillment, description="List of created fulfillments."
diff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.py
index 183d3b6695..adfb64dc78 100644
--- a/saleor/graphql/order/mutations/orders.py
+++ b/saleor/graphql/order/mutations/orders.py
@@ -20,11 +20,9 @@ from ....order.utils import get_valid_shipping_methods_for_order, update_order_p
from ....payment import CustomPaymentChoices, PaymentError, TransactionKind, gateway
from ...account.types import AddressInput
from ...core.mutations import BaseMutation
-from ...core.scalars import UUID, PositiveDecimal
+from ...core.scalars import PositiveDecimal
from ...core.types.common import OrderError
from ...core.utils import validate_required_string_field
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
-from ...meta.deprecated.types import MetaInput, MetaPath
from ...order.mutations.draft_orders import DraftOrderCreate
from ...order.types import Order, OrderEvent
from ...shipping.types import ShippingMethod
@@ -485,58 +483,3 @@ class OrderRefund(BaseMutation):
if transaction.kind == TransactionKind.REFUND:
order_refunded(order, info.context.user, amount, payment)
return OrderRefund(order=order)
-
-
-class OrderUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates meta for order."
- model = models.Order
- public = True
-
- class Arguments:
- token = UUID(description="Token of an object to update.", required=True)
- input = MetaInput(
- description="Fields required to update new or stored metadata item.",
- required=True,
- )
-
- @classmethod
- def get_instance(cls, info, **data):
- token = data["token"]
- return models.Order.objects.get(token=token)
-
-
-class OrderUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Updates private meta for order."
- model = models.Order
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = False
-
-
-class OrderClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears stored metadata value."
- model = models.Order
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = True
-
- class Arguments:
- token = UUID(description="Token of an object to clear.", required=True)
- input = MetaPath(
- description="Fields required to update new or stored metadata item.",
- required=True,
- )
-
- @classmethod
- def get_instance(cls, info, **data):
- token = data["token"]
- return models.Order.objects.get(token=token)
-
-
-class OrderClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears stored private metadata value."
- model = models.Order
- permissions = (OrderPermissions.MANAGE_ORDERS,)
- public = False
diff --git a/saleor/graphql/order/schema.py b/saleor/graphql/order/schema.py
index 7c0f79c168..80fe1fc5e1 100644
--- a/saleor/graphql/order/schema.py
+++ b/saleor/graphql/order/schema.py
@@ -21,10 +21,6 @@ from .mutations.draft_orders import (
)
from .mutations.fulfillments import (
FulfillmentCancel,
- FulfillmentClearMeta,
- FulfillmentClearPrivateMeta,
- FulfillmentUpdateMeta,
- FulfillmentUpdatePrivateMeta,
FulfillmentUpdateTracking,
OrderFulfill,
)
@@ -32,13 +28,9 @@ from .mutations.orders import (
OrderAddNote,
OrderCancel,
OrderCapture,
- OrderClearMeta,
- OrderClearPrivateMeta,
OrderMarkAsPaid,
OrderRefund,
OrderUpdate,
- OrderUpdateMeta,
- OrderUpdatePrivateMeta,
OrderUpdateShipping,
OrderVoid,
)
@@ -159,61 +151,12 @@ class OrderMutations(graphene.ObjectType):
order_add_note = OrderAddNote.Field()
order_cancel = OrderCancel.Field()
order_capture = OrderCapture.Field()
- order_clear_private_meta = OrderClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- order_clear_meta = OrderClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
order_fulfill = OrderFulfill.Field()
order_fulfillment_cancel = FulfillmentCancel.Field()
order_fulfillment_update_tracking = FulfillmentUpdateTracking.Field()
- order_fulfillment_clear_meta = FulfillmentClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- order_fulfillment_clear_private_meta = FulfillmentClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- order_fulfillment_update_meta = FulfillmentUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- order_fulfillment_update_private_meta = FulfillmentUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
order_mark_as_paid = OrderMarkAsPaid.Field()
order_refund = OrderRefund.Field()
order_update = OrderUpdate.Field()
- order_update_meta = OrderUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- order_update_private_meta = OrderUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
order_update_shipping = OrderUpdateShipping.Field()
order_void = OrderVoid.Field()
-
order_bulk_cancel = OrderBulkCancel.Field()
diff --git a/saleor/graphql/order/tests/test_fulfillment.py b/saleor/graphql/order/tests/test_fulfillment.py
index baf96914d4..e61b9d5a68 100644
--- a/saleor/graphql/order/tests/test_fulfillment.py
+++ b/saleor/graphql/order/tests/test_fulfillment.py
@@ -1,11 +1,9 @@
from unittest.mock import patch
import graphene
-import pytest
from django.contrib.auth.models import AnonymousUser
from ....core.exceptions import InsufficientStock
-from ....core.permissions import OrderPermissions
from ....order import OrderStatus
from ....order.error_codes import OrderErrorCode
from ....order.events import OrderEvents
@@ -729,240 +727,6 @@ def test_create_digital_fulfillment(
assert mock_email_fulfillment.call_count == 1
-def update_metadata_mutation():
- return """
- mutation UpdateMeta($id: ID!, $input: MetaInput!){
- orderFulfillmentUpdateMeta(id: $id, input: $input) {
- errors {
- field
- message
- }
- }
- }
- """
-
-
-def update_private_metadata_mutation():
- return """
- mutation UpdatePrivateMeta($id: ID!, $input: MetaInput!){
- orderFulfillmentUpdatePrivateMeta(id: $id, input: $input) {
- errors {
- field
- message
- }
- }
- }
- """
-
-
-def clear_metadata_mutation():
- return """
- mutation fulfillmentClearMeta($id: ID!, $input: MetaPath!) {
- orderFulfillmentClearMeta(id: $id, input: $input) {
- errors {
- message
- }
- }
- }
- """
-
-
-def clear_private_metadata_mutation():
- return """
- mutation fulfillmentClearPrivateMeta($id: ID!, $input: MetaPath!) {
- orderFulfillmentClearPrivateMeta(id: $id, input: $input) {
- errors {
- message
- }
- }
- }
- """
-
-
-def clear_meta_variables(fulfillment):
- fulfillment_id = graphene.Node.to_global_id("Fulfillment", fulfillment.id)
- return {
- "id": fulfillment_id,
- "input": {"namespace": "", "clientName": "", "key": "foo"},
- }
-
-
-def update_metadata_variables(staff_user, fulfillment):
- fulfillment_id = graphene.Node.to_global_id("Fulfillment", fulfillment.id)
- return {
- "id": fulfillment_id,
- "input": {
- "namespace": "",
- "clientName": "",
- "key": str(staff_user),
- "value": "bar",
- },
- }
-
-
-def test_fulfillment_update_metadata_user_has_no_permision(
- staff_api_client, staff_user, update_metadata_mutation, update_metadata_variables
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
-
- response = staff_api_client.post_graphql(
- update_metadata_mutation,
- update_metadata_variables,
- permissions=[],
- check_no_permissions=False,
- )
- assert_no_permission(response)
-
-
-def test_fulfillment_update_metadata_user_has_permission(
- staff_api_client,
- staff_user,
- permission_manage_orders,
- fulfillment,
- update_metadata_mutation,
- update_metadata_variables,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- update_metadata_mutation,
- update_metadata_variables,
- permissions=[permission_manage_orders],
- check_no_permissions=False,
- )
- assert response.status_code == 200
- content = get_graphql_content(response)
- errors = content["data"]["orderFulfillmentUpdateMeta"]["errors"]
- assert len(errors) == 0
- fulfillment.refresh_from_db()
- assert fulfillment.metadata == {str(staff_user): "bar"}
-
-
-def test_fulfillment_update_private_metadata_user_has_no_permission(
- staff_api_client,
- staff_user,
- update_private_metadata_mutation,
- update_metadata_variables,
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
-
- response = staff_api_client.post_graphql(
- update_private_metadata_mutation,
- update_metadata_variables,
- permissions=[],
- check_no_permissions=False,
- )
- assert_no_permission(response)
-
-
-def test_fulfillment_update_private_metadata_user_has_permission(
- staff_api_client,
- staff_user,
- permission_manage_orders,
- fulfillment,
- update_private_metadata_mutation,
- update_metadata_variables,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- update_private_metadata_mutation,
- update_metadata_variables,
- permissions=[permission_manage_orders],
- check_no_permissions=False,
- )
- assert response.status_code == 200
- content = get_graphql_content(response)
- errors = content["data"]["orderFulfillmentUpdatePrivateMeta"]["errors"]
- assert len(errors) == 0
- fulfillment.refresh_from_db()
- assert fulfillment.private_metadata == {str(staff_user): "bar"}
-
-
-def test_fulfillment_clear_meta_user_has_no_permission(
- staff_api_client,
- staff_user,
- fulfillment,
- clear_meta_variables,
- clear_metadata_mutation,
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- fulfillment.store_value_in_metadata(items={"foo": "bar"})
- fulfillment.save()
- response = staff_api_client.post_graphql(
- clear_metadata_mutation, clear_meta_variables
- )
- assert_no_permission(response)
-
-
-def test_fulfillment_clear_meta_user_has_permission(
- staff_api_client,
- staff_user,
- permission_manage_orders,
- fulfillment,
- clear_meta_variables,
- clear_metadata_mutation,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- fulfillment.store_value_in_metadata(items={"foo": "bar"})
- fulfillment.save()
- fulfillment.refresh_from_db()
- response = staff_api_client.post_graphql(
- clear_metadata_mutation, clear_meta_variables
- )
- assert response.status_code == 200
- content = get_graphql_content(response)
- assert content.get("errors") is None
- fulfillment.refresh_from_db()
- assert not fulfillment.get_value_from_metadata(key="foo")
-
-
-def test_fulfillment_clear_private_meta_user_has_no_permission(
- staff_api_client,
- staff_user,
- fulfillment,
- clear_meta_variables,
- clear_private_metadata_mutation,
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- fulfillment.store_value_in_private_metadata(items={"foo": "bar"})
- fulfillment.save()
- response = staff_api_client.post_graphql(
- clear_private_metadata_mutation, clear_meta_variables
- )
- assert_no_permission(response)
-
-
-def test_fulfillment_clear_private_meta_user_has_permission(
- staff_api_client,
- staff_user,
- permission_manage_orders,
- fulfillment,
- clear_meta_variables,
- clear_private_metadata_mutation,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- fulfillment.store_value_in_private_metadata(items={"foo": "bar"})
- fulfillment.save()
- fulfillment.refresh_from_db()
- response = staff_api_client.post_graphql(
- clear_private_metadata_mutation, clear_meta_variables
- )
- assert response.status_code == 200
- content = get_graphql_content(response)
- assert content.get("errors") is None
- fulfillment.refresh_from_db()
- assert not fulfillment.get_value_from_private_metadata(key="foo")
-
-
QUERY_FULFILLMENT = """
query fulfillment($id: ID!){
order(id: $id){
diff --git a/saleor/graphql/order/tests/test_order.py b/saleor/graphql/order/tests/test_order.py
index e195b8a02f..23da015575 100644
--- a/saleor/graphql/order/tests/test_order.py
+++ b/saleor/graphql/order/tests/test_order.py
@@ -10,7 +10,6 @@ from freezegun import freeze_time
from prices import Money, TaxedMoney
from ....account.models import CustomerEvent
-from ....core.permissions import OrderPermissions
from ....core.taxes import TaxError, zero_taxed_money
from ....order import OrderStatus, events as order_events
from ....order.error_codes import OrderErrorCode
@@ -3627,215 +3626,3 @@ def test_draft_orders_query_with_filter_search_by_id(
response = staff_api_client.post_graphql(draft_orders_query_with_filter, variables)
content = get_graphql_content(response)
assert content["data"]["draftOrders"]["totalCount"] == 1
-
-
-def update_order_meta():
- return """
- mutation orderUpdateMeta($token: UUID!, $input: MetaInput!) {
- orderUpdateMeta(token: $token, input: $input){
- errors {
- message
- }
- }
- }
- """
-
-
-def update_order_private_meta():
- return """
- mutation orderUpdatePrivateMeta($id: ID!, $input: MetaInput!) {
- orderUpdatePrivateMeta(id: $id, input: $input){
- errors {
- message
- }
- }
- }
- """
-
-
-def order_meta_update_variables(order):
- return {
- "token": order.token,
- "input": {
- "namespace": "test",
- "clientName": "client1",
- "key": "foo",
- "value": "bar",
- },
- }
-
-
-def order_private_meta_update_variables(order):
- order_id = graphene.Node.to_global_id("Order", order.id)
- return {
- "id": order_id,
- "input": {
- "namespace": "test",
- "clientName": "client1",
- "key": "foo",
- "value": "bar",
- },
- }
-
-
-def test_user_without_permission_cannot_update_private_meta(
- staff_api_client,
- staff_user,
- update_order_private_meta,
- order_private_meta_update_variables,
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- update_order_private_meta, order_private_meta_update_variables
- )
- assert_no_permission(response)
-
-
-def test_user_does_not_need_permission_to_update_meta(
- staff_api_client, update_order_meta, order_meta_update_variables, order
-):
- response = staff_api_client.post_graphql(
- update_order_meta, order_meta_update_variables, permissions=[]
- )
- content = get_graphql_content(response)
- errors = content["data"]["orderUpdateMeta"]["errors"]
- assert len(errors) == 0
- order.refresh_from_db()
- assert order.get_value_from_metadata("foo") == "bar"
-
-
-def test_user_with_permission_can_update_private_meta(
- permission_manage_orders,
- staff_api_client,
- staff_user,
- update_order_private_meta,
- order_private_meta_update_variables,
- order,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- update_order_private_meta, order_private_meta_update_variables
- )
- content = get_graphql_content(response)
- errors = content["data"]["orderUpdatePrivateMeta"]["errors"]
- assert len(errors) == 0
- order.refresh_from_db()
- assert order.get_value_from_private_metadata("foo") == "bar"
-
-
-def clear_order_meta():
- return """
- mutation orderClearMeta($token: UUID!, $input: MetaPath!) {
- orderClearMeta(token: $token, input: $input) {
- errors {
- message
- }
- }
- }
- """
-
-
-def clear_order_private_meta():
- return """
- mutation orderClearPrivateMeta($id: ID!, $input: MetaPath!) {
- orderClearPrivateMeta(id: $id, input: $input) {
- errors {
- message
- }
- }
- }
- """
-
-
-def clear_meta_variables(order):
- return {
- "token": order.token,
- "input": {"namespace": "test", "clientName": "client1", "key": "foo"},
- }
-
-
-def clear_meta_private_variables(order):
- order_id = graphene.Node.to_global_id("Order", order.id)
- return {
- "id": order_id,
- "input": {
- "namespace": "testPrivate",
- "clientName": "clientPrivate1",
- "key": "foofoo",
- },
- }
-
-
-def order_with_meta(order):
- order.store_value_in_metadata(items={"foo": "bar"})
- order.store_value_in_private_metadata(items={"foofoo": "barbar"})
- order.save()
- return order
-
-
-def test_user_without_permission_cannot_clear_meta(
- staff_user, staff_api_client, clear_order_meta, clear_meta_variables
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(clear_order_meta, clear_meta_variables)
- assert_no_permission(response)
-
-
-def test_user_without_permission_cannot_clear_private_meta(
- staff_user, staff_api_client, clear_order_private_meta, clear_meta_private_variables
-):
- assert not staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- clear_order_private_meta, clear_meta_private_variables
- )
- assert_no_permission(response)
-
-
-def test_user_with_permission_can_clear_meta(
- staff_user,
- staff_api_client,
- clear_order_meta,
- clear_meta_variables,
- order_with_meta,
- permission_manage_orders,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(clear_order_meta, clear_meta_variables)
- assert response.status_code == 200
- content = get_graphql_content(response)
- errors = content["data"]["orderClearMeta"]["errors"]
- assert len(errors) == 0
- order_with_meta.refresh_from_db()
- assert not order_with_meta.get_value_from_metadata("foo")
-
-
-def test_user_with_permission_can_clear_private_meta(
- staff_user,
- staff_api_client,
- clear_order_private_meta,
- clear_meta_private_variables,
- order_with_meta,
- permission_manage_orders,
-):
- staff_user.user_permissions.add(permission_manage_orders)
- assert staff_user.has_perm(OrderPermissions.MANAGE_ORDERS)
- response = staff_api_client.post_graphql(
- clear_order_private_meta, clear_meta_private_variables
- )
- assert response.status_code == 200
- content = get_graphql_content(response)
- errors = content["data"]["orderClearPrivateMeta"]["errors"]
- assert len(errors) == 0
- order_with_meta.refresh_from_db()
- assert not order_with_meta.get_value_from_private_metadata(key="foofoo")
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index 07fa449ed7..293a352a3b 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -21,7 +21,6 @@ from ..core.types.money import Money, TaxedMoney
from ..decorators import one_of_permissions_required, permission_required
from ..giftcard.types import GiftCard
from ..invoice.types import Invoice
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..payment.types import OrderAction, Payment, PaymentChargeStatusEnum
from ..product.types import ProductVariant
@@ -222,15 +221,6 @@ class Fulfillment(CountableDjangoObjectType):
line = root.lines.first()
return line.stock.warehouse if line and line.stock else None
- @staticmethod
- @permission_required(OrderPermissions.MANAGE_ORDERS)
- def resolve_private_meta(root: models.Fulfillment, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Fulfillment, _info):
- return resolve_meta(root, _info)
-
class OrderLine(CountableDjangoObjectType):
thumbnail = graphene.Field(
@@ -556,12 +546,3 @@ class Order(CountableDjangoObjectType):
@staticmethod
def resolve_gift_cards(root: models.Order, _info):
return root.gift_cards.all()
-
- @staticmethod
- @permission_required(OrderPermissions.MANAGE_ORDERS)
- def resolve_private_meta(root: models.Order, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Order, _info):
- return resolve_meta(root, _info)
diff --git a/saleor/graphql/page/types.py b/saleor/graphql/page/types.py
index 3bb35795d3..5a655d7c22 100644
--- a/saleor/graphql/page/types.py
+++ b/saleor/graphql/page/types.py
@@ -2,7 +2,6 @@ from graphene import relay
from ...page import models
from ..core.connection import CountableDjangoObjectType
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..translations.fields import TranslationField
from ..translations.types import PageTranslation
@@ -30,11 +29,3 @@ class Page(CountableDjangoObjectType):
]
interfaces = [relay.Node, ObjectWithMetadata]
model = models.Page
-
- @staticmethod
- def resolve_meta(root: models.Page, info):
- return resolve_meta(root, info)
-
- @staticmethod
- def resolve_private_meta(root: models.Page, _info):
- return resolve_private_meta(root, _info)
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index c03d990f76..84e0509f3b 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -16,7 +16,6 @@ from ...core.utils import (
validate_slug_and_generate_if_needed,
)
from ...core.utils.reordering import perform_reordering
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ...product.types import ProductType
from ..descriptions import AttributeDescriptions, AttributeValueDescriptions
from ..enums import AttributeInputTypeEnum, AttributeTypeEnum
@@ -511,46 +510,6 @@ class AttributeDelete(ModelDeleteMutation):
error_type_field = "product_errors"
-class AttributeUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Attribute
- description = "Update public metadata for attribute."
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class AttributeClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears public metadata item for attribute."
- model = models.Attribute
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class AttributeUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Update public metadata for attribute."
- model = models.Attribute
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class AttributeClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears public metadata item for attribute."
- model = models.Attribute
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
def validate_value_is_unique(attribute: models.Attribute, value: models.AttributeValue):
"""Check if the attribute value is unique within the attribute it belongs to."""
duplicated_values = attribute.values.exclude(pk=value.pk).filter(slug=value.slug)
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 6d60a1259b..2ea4300f6f 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -43,7 +43,6 @@ from ...core.utils import (
)
from ...core.utils.reordering import perform_reordering
from ...core.validators import validate_price_precision
-from ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutation
from ...warehouse.types import Warehouse
from ..types import (
Category,
@@ -420,86 +419,6 @@ class CollectionRemoveProducts(BaseMutation):
return CollectionRemoveProducts(collection=collection)
-class CollectionUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Collection
- description = "Update public metadata for collection."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CollectionClearMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.Collection
- description = "Clears public metadata for collection."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CollectionUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Collection
- description = "Update private metadata for collection."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CollectionClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.Collection
- description = "Clears private metadata item for collection."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CategoryUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Category
- description = "Update public metadata for category."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CategoryClearMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.Category
- description = "Clears public metadata for category."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CategoryUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Category
- description = "Update private metadata for category."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class CategoryClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.Category
- description = "Clears private metadata for category."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
class AttributeValueInput(InputObjectType):
id = graphene.ID(description="ID of the selected attribute.")
values = graphene.List(
@@ -1112,46 +1031,6 @@ class ProductDelete(ModelDeleteMutation):
return response
-class ProductUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.Product
- description = "Update public metadata for product."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears public metadata item for product."
- model = models.Product
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Update private metadata for product."
- model = models.Product
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears private metadata item for product."
- model = models.Product
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
class ProductVariantInput(graphene.InputObjectType):
attributes = graphene.List(
AttributeValueInput,
@@ -1454,46 +1333,6 @@ class ProductVariantDelete(ModelDeleteMutation):
return response
-class ProductVariantUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.ProductVariant
- description = "Update public metadata for product variant."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductVariantClearMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.ProductVariant
- description = "Clears public metadata for product variant."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductVariantUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.ProductVariant
- description = "Update private metadata for product variant."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductVariantClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- model = models.ProductVariant
- description = "Clears private metadata for product variant."
- permissions = (ProductPermissions.MANAGE_PRODUCTS,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
class ProductTypeInput(graphene.InputObjectType):
name = graphene.String(description="Name of the product type.")
slug = graphene.String(description="Product type slug.")
@@ -1645,46 +1484,6 @@ class ProductTypeDelete(ModelDeleteMutation):
return response
-class ProductTypeUpdateMeta(UpdateMetaBaseMutation):
- class Meta:
- model = models.ProductType
- description = "Update public metadata for product type."
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductTypeClearMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears public metadata for product type."
- model = models.ProductType
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = True
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductTypeUpdatePrivateMeta(UpdateMetaBaseMutation):
- class Meta:
- description = "Update private metadata for product type."
- model = models.ProductType
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
-class ProductTypeClearPrivateMeta(ClearMetaBaseMutation):
- class Meta:
- description = "Clears private metadata for product type."
- model = models.ProductType
- permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)
- public = False
- error_type_class = ProductError
- error_type_field = "product_errors"
-
-
class ProductImageCreateInput(graphene.InputObjectType):
alt = graphene.String(description="Alt text for an image.")
image = Upload(
diff --git a/saleor/graphql/product/schema.py b/saleor/graphql/product/schema.py
index 9825dbc26d..e83a3b777f 100644
--- a/saleor/graphql/product/schema.py
+++ b/saleor/graphql/product/schema.py
@@ -39,15 +39,11 @@ from .filters import (
)
from .mutations.attributes import (
AttributeAssign,
- AttributeClearMeta,
- AttributeClearPrivateMeta,
AttributeCreate,
AttributeDelete,
AttributeReorderValues,
AttributeUnassign,
AttributeUpdate,
- AttributeUpdateMeta,
- AttributeUpdatePrivateMeta,
AttributeValueCreate,
AttributeValueDelete,
AttributeValueUpdate,
@@ -60,25 +56,15 @@ from .mutations.digital_contents import (
DigitalContentUrlCreate,
)
from .mutations.products import (
- CategoryClearMeta,
- CategoryClearPrivateMeta,
CategoryCreate,
CategoryDelete,
CategoryUpdate,
- CategoryUpdateMeta,
- CategoryUpdatePrivateMeta,
CollectionAddProducts,
- CollectionClearMeta,
- CollectionClearPrivateMeta,
CollectionCreate,
CollectionDelete,
CollectionRemoveProducts,
CollectionReorderProducts,
CollectionUpdate,
- CollectionUpdateMeta,
- CollectionUpdatePrivateMeta,
- ProductClearMeta,
- ProductClearPrivateMeta,
ProductCreate,
ProductDelete,
ProductImageCreate,
@@ -86,25 +72,15 @@ from .mutations.products import (
ProductImageReorder,
ProductImageUpdate,
ProductSetAvailabilityForPurchase,
- ProductTypeClearMeta,
- ProductTypeClearPrivateMeta,
ProductTypeCreate,
ProductTypeDelete,
ProductTypeUpdate,
- ProductTypeUpdateMeta,
- ProductTypeUpdatePrivateMeta,
ProductUpdate,
- ProductUpdateMeta,
- ProductUpdatePrivateMeta,
- ProductVariantClearMeta,
- ProductVariantClearPrivateMeta,
ProductVariantCreate,
ProductVariantDelete,
ProductVariantReorder,
ProductVariantSetDefault,
ProductVariantUpdate,
- ProductVariantUpdateMeta,
- ProductVariantUpdatePrivateMeta,
VariantImageAssign,
VariantImageUnassign,
)
@@ -324,30 +300,6 @@ class ProductMutations(graphene.ObjectType):
attribute_unassign = AttributeUnassign.Field()
attribute_update = AttributeUpdate.Field()
attribute_translate = AttributeTranslate.Field()
- attribute_update_metadata = AttributeUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- attribute_clear_metadata = AttributeClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- attribute_update_private_metadata = AttributeUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- attribute_clear_private_metadata = AttributeClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
attribute_value_create = AttributeValueCreate.Field()
attribute_value_delete = AttributeValueDelete.Field()
@@ -361,30 +313,6 @@ class ProductMutations(graphene.ObjectType):
category_bulk_delete = CategoryBulkDelete.Field()
category_update = CategoryUpdate.Field()
category_translate = CategoryTranslate.Field()
- category_update_metadata = CategoryUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- category_clear_metadata = CategoryClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- category_update_private_metadata = CategoryUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- category_clear_private_metadata = CategoryClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
collection_add_products = CollectionAddProducts.Field()
collection_create = CollectionCreate.Field()
@@ -395,30 +323,6 @@ class ProductMutations(graphene.ObjectType):
collection_remove_products = CollectionRemoveProducts.Field()
collection_update = CollectionUpdate.Field()
collection_translate = CollectionTranslate.Field()
- collection_update_metadata = CollectionUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- collection_clear_metadata = CollectionClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- collection_update_private_metadata = CollectionUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- collection_clear_private_metadata = CollectionClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
product_create = ProductCreate.Field()
product_delete = ProductDelete.Field()
@@ -426,30 +330,6 @@ class ProductMutations(graphene.ObjectType):
product_bulk_publish = ProductBulkPublish.Field()
product_update = ProductUpdate.Field()
product_translate = ProductTranslate.Field()
- product_update_metadata = ProductUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_clear_metadata = ProductClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_update_private_metadata = ProductUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- product_clear_private_metadata = ProductClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
product_set_availability_for_purchase = ProductSetAvailabilityForPurchase.Field()
@@ -466,31 +346,6 @@ class ProductMutations(graphene.ObjectType):
product_type_update = ProductTypeUpdate.Field()
product_type_reorder_attributes = ProductTypeReorderAttributes.Field()
- product_type_update_metadata = ProductTypeUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_type_clear_metadata = ProductTypeClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_type_update_private_metadata = ProductTypeUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- product_type_clear_private_metadata = ProductTypeClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
-
digital_content_create = DigitalContentCreate.Field()
digital_content_delete = DigitalContentDelete.Field()
digital_content_update = DigitalContentUpdate.Field()
@@ -507,30 +362,6 @@ class ProductMutations(graphene.ObjectType):
product_variant_update = ProductVariantUpdate.Field()
product_variant_set_default = ProductVariantSetDefault.Field()
product_variant_translate = ProductVariantTranslate.Field()
- product_variant_update_metadata = ProductVariantUpdateMeta.Field(
- deprecation_reason=(
- "Use the `updateMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_variant_clear_metadata = ProductVariantClearMeta.Field(
- deprecation_reason=(
- "Use the `deleteMetadata` mutation instead. This field will be removed "
- "after 2020-07-31."
- )
- )
- product_variant_update_private_metadata = ProductVariantUpdatePrivateMeta.Field(
- deprecation_reason=(
- "Use the `updatePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
- product_variant_clear_private_metadata = ProductVariantClearPrivateMeta.Field(
- deprecation_reason=(
- "Use the `deletePrivateMetadata` mutation instead. This field will be "
- "removed after 2020-07-31."
- )
- )
variant_image_assign = VariantImageAssign.Field()
variant_image_unassign = VariantImageUnassign.Field()
diff --git a/saleor/graphql/product/tests/test_product.py b/saleor/graphql/product/tests/test_product.py
index d03bfc859b..64857c1a39 100644
--- a/saleor/graphql/product/tests/test_product.py
+++ b/saleor/graphql/product/tests/test_product.py
@@ -4380,7 +4380,7 @@ def test_report_product_sales(
assert Decimal(amount) == line_b.quantity * line_b.unit_price_gross_amount
[email protected]("field", ("purchaseCost", "margin", "privateMeta"))
[email protected]("field", ("purchaseCost", "margin"))
def test_product_restricted_fields_permissions(
staff_api_client,
permission_manage_products,
@@ -4415,7 +4415,6 @@ def test_product_restricted_fields_permissions(
("costPrice", True),
("price", True),
("quantityOrdered", False),
- ("privateMeta", True),
),
)
def test_variant_restricted_fields_permissions(
diff --git a/saleor/graphql/product/types/attributes.py b/saleor/graphql/product/types/attributes.py
index 0cbbce4626..5b9975e11a 100644
--- a/saleor/graphql/product/types/attributes.py
+++ b/saleor/graphql/product/types/attributes.py
@@ -7,7 +7,6 @@ from ....core.permissions import ProductPermissions
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...decorators import permission_required
-from ...meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ...meta.types import ObjectWithMetadata
from ...translations.fields import TranslationField
from ...translations.types import AttributeTranslation, AttributeValueTranslation
@@ -103,15 +102,6 @@ class Attribute(CountableDjangoObjectType):
def resolve_values(root: models.Attribute, info):
return AttributeValuesByAttributeIdLoader(info.context).load(root.id)
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.Attribute, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Attribute, _info):
- return resolve_meta(root, _info)
-
@staticmethod
@permission_required(ProductPermissions.MANAGE_PRODUCTS)
def resolve_value_required(root: models.Attribute, *_args):
diff --git a/saleor/graphql/product/types/digital_contents.py b/saleor/graphql/product/types/digital_contents.py
index bdad5aa891..c10a1ee9d1 100644
--- a/saleor/graphql/product/types/digital_contents.py
+++ b/saleor/graphql/product/types/digital_contents.py
@@ -1,12 +1,9 @@
import graphene
from graphene import relay
-from ....core.permissions import ProductPermissions
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...core.scalars import UUID
-from ...decorators import permission_required
-from ...meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ...meta.types import ObjectWithMetadata
@@ -45,14 +42,5 @@ class DigitalContent(CountableDjangoObjectType):
interfaces = (relay.Node, ObjectWithMetadata)
@staticmethod
- def resolve_urls(root: models.DigitalContent, info, **_kwargs):
+ def resolve_urls(root: models.DigitalContent, **_kwargs):
return root.urls.all()
-
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.DigitalContent, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.DigitalContent, _info):
- return resolve_meta(root, _info)
diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.py
index fce4651369..efb32c03c2 100644
--- a/saleor/graphql/product/types/products.py
+++ b/saleor/graphql/product/types/products.py
@@ -32,7 +32,6 @@ from ...core.fields import FilterInputConnectionField, PrefetchingConnectionFiel
from ...core.types import Image, Money, MoneyRange, TaxedMoney, TaxedMoneyRange, TaxType
from ...decorators import one_of_permissions_required, permission_required
from ...discount.dataloaders import DiscountsByDateTimeLoader
-from ...meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ...meta.types import ObjectWithMetadata
from ...translations.fields import TranslationField
from ...translations.types import (
@@ -419,15 +418,6 @@ class ProductVariant(CountableDjangoObjectType):
qs = cls._meta.model.objects.filter(product__id__in=visible_products)
return qs.filter(pk=pk).first()
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.ProductVariant, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.ProductVariant, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
@@ -636,15 +626,6 @@ class Product(CountableDjangoObjectType):
return qs.filter(pk=pk).first()
return None
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.Product, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Product, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
@@ -729,15 +710,6 @@ class ProductType(CountableDjangoObjectType):
qs = models.Attribute.objects.get_unassigned_attributes(root.pk)
return resolve_attributes(info, qs=qs, **kwargs)
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.ProductType, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.ProductType, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
@@ -799,15 +771,6 @@ class Collection(CountableDjangoObjectType):
return qs.filter(id=id).first()
return None
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.Collection, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Collection, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
@@ -885,15 +848,6 @@ class Category(CountableDjangoObjectType):
qs = qs.exclude(visible_in_listings=False)
return qs.filter(category__in=tree)
- @staticmethod
- @permission_required(ProductPermissions.MANAGE_PRODUCTS)
- def resolve_private_meta(root: models.Category, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.Category, _info):
- return resolve_meta(root, _info)
-
@staticmethod
def __resolve_reference(root, _info, **_kwargs):
return graphene.Node.get_node_from_global_id(_info, root.id)
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 75733bc781..953544b3fa 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -106,12 +106,6 @@ type AccountUpdate {
user: User
}
-type AccountUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- user: User
-}
-
type Address implements Node {
id: ID!
firstName: String!
@@ -210,8 +204,6 @@ type App implements Node & ObjectWithMetadata {
tokens: [AppToken]
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
type: AppTypeEnum
webhooks: [Webhook]
aboutApp: String
@@ -400,8 +392,6 @@ type Attribute implements Node & ObjectWithMetadata {
productVariantTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
inputType: AttributeInputTypeEnum
name: String
slug: String
@@ -432,18 +422,6 @@ type AttributeBulkDelete {
productErrors: [ProductError!]!
}
-type AttributeClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- attribute: Attribute
-}
-
-type AttributeClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- attribute: Attribute
-}
-
type AttributeCountableConnection {
pageInfo: PageInfo!
edges: [AttributeCountableEdge!]!
@@ -578,18 +556,6 @@ input AttributeUpdateInput {
availableInGrid: Boolean
}
-type AttributeUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- attribute: Attribute
-}
-
-type AttributeUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- attribute: Attribute
-}
-
type AttributeValue implements Node {
id: ID!
name: String
@@ -725,8 +691,6 @@ type Category implements Node & ObjectWithMetadata {
level: Int!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
ancestors(before: String, after: String, first: Int, last: Int): CategoryCountableConnection
products(before: String, after: String, first: Int, last: Int): ProductCountableConnection
url: String @deprecated(reason: "This field will be removed after 2020-07-31.")
@@ -741,18 +705,6 @@ type CategoryBulkDelete {
productErrors: [ProductError!]!
}
-type CategoryClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- category: Category
-}
-
-type CategoryClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- category: Category
-}
-
type CategoryCountableConnection {
pageInfo: PageInfo!
edges: [CategoryCountableEdge!]!
@@ -835,18 +787,6 @@ type CategoryUpdate {
category: Category
}
-type CategoryUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- category: Category
-}
-
-type CategoryUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- category: Category
-}
-
type Checkout implements Node & ObjectWithMetadata {
created: DateTime!
lastChange: DateTime!
@@ -864,8 +804,6 @@ type Checkout implements Node & ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
availableShippingMethods: [ShippingMethod]!
availablePaymentGateways: [PaymentGateway!]!
email: String!
@@ -889,18 +827,6 @@ type CheckoutBillingAddressUpdate {
checkoutErrors: [CheckoutError!]!
}
-type CheckoutClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- checkoutErrors: [CheckoutError!]!
- checkout: Checkout
-}
-
-type CheckoutClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- checkoutErrors: [CheckoutError!]!
- checkout: Checkout
-}
-
type CheckoutComplete {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
@@ -1049,18 +975,6 @@ type CheckoutShippingMethodUpdate {
checkoutErrors: [CheckoutError!]!
}
-type CheckoutUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- checkoutErrors: [CheckoutError!]!
- checkout: Checkout
-}
-
-type CheckoutUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- checkoutErrors: [CheckoutError!]!
- checkout: Checkout
-}
-
type ChoiceValue {
raw: String
verbose: String
@@ -1078,8 +992,6 @@ type Collection implements Node & ObjectWithMetadata {
slug: String!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
products(filter: ProductFilterInput, sortBy: ProductOrder, before: String, after: String, first: Int, last: Int): ProductCountableConnection
backgroundImage(size: Int): Image
translation(languageCode: LanguageCodeEnum!): CollectionTranslation
@@ -1103,18 +1015,6 @@ type CollectionBulkPublish {
productErrors: [ProductError!]!
}
-type CollectionClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- collection: Collection
-}
-
-type CollectionClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- collection: Collection
-}
-
type CollectionCountableConnection {
pageInfo: PageInfo!
edges: [CollectionCountableEdge!]!
@@ -1231,18 +1131,6 @@ type CollectionUpdate {
collection: Collection
}
-type CollectionUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- collection: Collection
-}
-
-type CollectionUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- collection: Collection
-}
-
type ConfigurationItem {
name: String!
value: String
@@ -1662,8 +1550,6 @@ type DigitalContent implements Node & ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
}
type DigitalContentCountableConnection {
@@ -1959,8 +1845,6 @@ type Fulfillment implements Node & ObjectWithMetadata {
created: DateTime!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
lines: [FulfillmentLine]
statusDisplay: String
warehouse: Warehouse
@@ -1977,16 +1861,6 @@ input FulfillmentCancelInput {
warehouseId: ID!
}
-type FulfillmentClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- fulfillment: Fulfillment
-}
-
-type FulfillmentClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- fulfillment: Fulfillment
-}
-
type FulfillmentLine implements Node {
id: ID!
quantity: Int!
@@ -1998,16 +1872,6 @@ enum FulfillmentStatus {
CANCELED
}
-type FulfillmentUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- fulfillment: Fulfillment
-}
-
-type FulfillmentUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- fulfillment: Fulfillment
-}
-
type FulfillmentUpdateTracking {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
fulfillment: Fulfillment
@@ -2152,8 +2016,6 @@ type Invoice implements ObjectWithMetadata & Job & Node {
number: String
externalUrl: String
privateMetadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
createdAt: DateTime!
updatedAt: DateTime!
message: String
@@ -2508,34 +2370,6 @@ type MenuUpdate {
menu: Menu
}
-type MetaClientStore {
- name: String!
- metadata: [MetaItem]!
-}
-
-input MetaInput {
- namespace: String!
- clientName: String!
- key: String!
- value: String!
-}
-
-type MetaItem {
- key: String!
- value: String!
-}
-
-input MetaPath {
- namespace: String!
- clientName: String!
- key: String!
-}
-
-type MetaStore {
- namespace: String!
- clients: [MetaClientStore]!
-}
-
type MetadataError {
field: String
message: String
@@ -2611,10 +2445,6 @@ type Mutation {
attributeUnassign(attributeIds: [ID]!, productTypeId: ID!): AttributeUnassign
attributeUpdate(id: ID!, input: AttributeUpdateInput!): AttributeUpdate
attributeTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): AttributeTranslate
- attributeUpdateMetadata(id: ID!, input: MetaInput!): AttributeUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- attributeClearMetadata(id: ID!, input: MetaPath!): AttributeClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- attributeUpdatePrivateMetadata(id: ID!, input: MetaInput!): AttributeUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- attributeClearPrivateMetadata(id: ID!, input: MetaPath!): AttributeClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
attributeValueCreate(attribute: ID!, input: AttributeValueCreateInput!): AttributeValueCreate
attributeValueDelete(id: ID!): AttributeValueDelete
attributeValueBulkDelete(ids: [ID]!): AttributeValueBulkDelete
@@ -2626,10 +2456,6 @@ type Mutation {
categoryBulkDelete(ids: [ID]!): CategoryBulkDelete
categoryUpdate(id: ID!, input: CategoryInput!): CategoryUpdate
categoryTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): CategoryTranslate
- categoryUpdateMetadata(id: ID!, input: MetaInput!): CategoryUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- categoryClearMetadata(id: ID!, input: MetaPath!): CategoryClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- categoryUpdatePrivateMetadata(id: ID!, input: MetaInput!): CategoryUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- categoryClearPrivateMetadata(id: ID!, input: MetaPath!): CategoryClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
collectionAddProducts(collectionId: ID!, products: [ID]!): CollectionAddProducts
collectionCreate(input: CollectionCreateInput!): CollectionCreate
collectionDelete(id: ID!): CollectionDelete
@@ -2639,20 +2465,12 @@ type Mutation {
collectionRemoveProducts(collectionId: ID!, products: [ID]!): CollectionRemoveProducts
collectionUpdate(id: ID!, input: CollectionInput!): CollectionUpdate
collectionTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): CollectionTranslate
- collectionUpdateMetadata(id: ID!, input: MetaInput!): CollectionUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- collectionClearMetadata(id: ID!, input: MetaPath!): CollectionClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- collectionUpdatePrivateMetadata(id: ID!, input: MetaInput!): CollectionUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- collectionClearPrivateMetadata(id: ID!, input: MetaPath!): CollectionClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
productCreate(input: ProductCreateInput!): ProductCreate
productDelete(id: ID!): ProductDelete
productBulkDelete(ids: [ID]!): ProductBulkDelete
productBulkPublish(ids: [ID]!, isPublished: Boolean!): ProductBulkPublish
productUpdate(id: ID!, input: ProductInput!): ProductUpdate
productTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): ProductTranslate
- productUpdateMetadata(id: ID!, input: MetaInput!): ProductUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productClearMetadata(id: ID!, input: MetaPath!): ProductClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productUpdatePrivateMetadata(id: ID!, input: MetaInput!): ProductUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productClearPrivateMetadata(id: ID!, input: MetaPath!): ProductClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
productSetAvailabilityForPurchase(isAvailable: Boolean!, productId: ID!, startDate: Date): ProductSetAvailabilityForPurchase
productImageCreate(input: ProductImageCreateInput!): ProductImageCreate
productVariantReorder(moves: [ReorderInput]!, productId: ID!): ProductVariantReorder
@@ -2665,10 +2483,6 @@ type Mutation {
productTypeBulkDelete(ids: [ID]!): ProductTypeBulkDelete
productTypeUpdate(id: ID!, input: ProductTypeInput!): ProductTypeUpdate
productTypeReorderAttributes(moves: [ReorderInput]!, productTypeId: ID!, type: AttributeTypeEnum!): ProductTypeReorderAttributes
- productTypeUpdateMetadata(id: ID!, input: MetaInput!): ProductTypeUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productTypeClearMetadata(id: ID!, input: MetaPath!): ProductTypeClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productTypeUpdatePrivateMetadata(id: ID!, input: MetaInput!): ProductTypeUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productTypeClearPrivateMetadata(id: ID!, input: MetaPath!): ProductTypeClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
digitalContentCreate(input: DigitalContentUploadInput!, variantId: ID!): DigitalContentCreate
digitalContentDelete(variantId: ID!): DigitalContentDelete
digitalContentUpdate(input: DigitalContentInput!, variantId: ID!): DigitalContentUpdate
@@ -2683,10 +2497,6 @@ type Mutation {
productVariantUpdate(id: ID!, input: ProductVariantInput!): ProductVariantUpdate
productVariantSetDefault(productId: ID!, variantId: ID!): ProductVariantSetDefault
productVariantTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): ProductVariantTranslate
- productVariantUpdateMetadata(id: ID!, input: MetaInput!): ProductVariantUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productVariantClearMetadata(id: ID!, input: MetaPath!): ProductVariantClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productVariantUpdatePrivateMetadata(id: ID!, input: MetaInput!): ProductVariantUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- productVariantClearPrivateMetadata(id: ID!, input: MetaPath!): ProductVariantClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
variantImageAssign(imageId: ID!, variantId: ID!): VariantImageAssign
variantImageUnassign(imageId: ID!, variantId: ID!): VariantImageUnassign
paymentCapture(amount: PositiveDecimal, paymentId: ID!): PaymentCapture
@@ -2710,20 +2520,12 @@ type Mutation {
orderAddNote(order: ID!, input: OrderAddNoteInput!): OrderAddNote
orderCancel(id: ID!): OrderCancel
orderCapture(amount: PositiveDecimal!, id: ID!): OrderCapture
- orderClearPrivateMeta(id: ID!, input: MetaPath!): OrderClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- orderClearMeta(input: MetaPath!, token: UUID!): OrderClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
orderFulfill(input: OrderFulfillInput!, order: ID): OrderFulfill
orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput!): FulfillmentCancel
orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking
- orderFulfillmentClearMeta(id: ID!, input: MetaPath!): FulfillmentClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation instead. This field will be removed after 2020-07-31.")
- orderFulfillmentClearPrivateMeta(id: ID!, input: MetaPath!): FulfillmentClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- orderFulfillmentUpdateMeta(id: ID!, input: MetaInput!): FulfillmentUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- orderFulfillmentUpdatePrivateMeta(id: ID!, input: MetaInput!): FulfillmentUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
orderMarkAsPaid(id: ID!): OrderMarkAsPaid
orderRefund(amount: PositiveDecimal!, id: ID!): OrderRefund
orderUpdate(id: ID!, input: OrderUpdateInput!): OrderUpdate
- orderUpdateMeta(input: MetaInput!, token: UUID!): OrderUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation instead. This field will be removed after 2020-07-31.")
- orderUpdatePrivateMeta(id: ID!, input: MetaInput!): OrderUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation instead. This field will be removed after 2020-07-31.")
orderUpdateShipping(order: ID!, input: OrderUpdateShippingInput): OrderUpdateShipping
orderVoid(id: ID!): OrderVoid
orderBulkCancel(ids: [ID]!): OrderBulkCancel
@@ -2782,10 +2584,6 @@ type Mutation {
checkoutPaymentCreate(checkoutId: ID!, input: PaymentInput!): CheckoutPaymentCreate
checkoutShippingAddressUpdate(checkoutId: ID!, shippingAddress: AddressInput!): CheckoutShippingAddressUpdate
checkoutShippingMethodUpdate(checkoutId: ID, shippingMethodId: ID!): CheckoutShippingMethodUpdate
- checkoutUpdateMetadata(id: ID!, input: MetaInput!): CheckoutUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation. This field will be removed after 2020-07-31.")
- checkoutClearMetadata(id: ID!, input: MetaPath!): CheckoutClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation. This field will be removed after 2020-07-31.")
- checkoutUpdatePrivateMetadata(id: ID!, input: MetaInput!): CheckoutUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation. This field will be removed after 2020-07-31.")
- checkoutClearPrivateMetadata(id: ID!, input: MetaPath!): CheckoutClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation. This field will be removed after 2020-07-31.")
appCreate(input: AppInput!): AppCreate
appUpdate(id: ID!, input: AppInput!): AppUpdate
appDelete(id: ID!): AppDelete
@@ -2816,7 +2614,6 @@ type Mutation {
accountUpdate(input: AccountInput!): AccountUpdate
accountRequestDeletion(redirectUrl: String!): AccountRequestDeletion
accountDelete(token: String!): AccountDelete
- accountUpdateMeta(input: MetaInput!): AccountUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation. This field will be removed after 2020-07-31.")
addressCreate(input: AddressInput!, userId: ID!): AddressCreate
addressUpdate(id: ID!, input: AddressInput!): AddressUpdate
addressDelete(id: ID!): AddressDelete
@@ -2832,15 +2629,9 @@ type Mutation {
userAvatarUpdate(image: Upload!): UserAvatarUpdate
userAvatarDelete: UserAvatarDelete
userBulkSetActive(ids: [ID]!, isActive: Boolean!): UserBulkSetActive
- userUpdateMetadata(id: ID!, input: MetaInput!): UserUpdateMeta @deprecated(reason: "Use the `updateMetadata` mutation. This field will be removed after 2020-07-31.")
- userClearMetadata(id: ID!, input: MetaPath!): UserClearMeta @deprecated(reason: "Use the `deleteMetadata` mutation. This field will be removed after 2020-07-31.")
- userUpdatePrivateMetadata(id: ID!, input: MetaInput!): UserUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation. This field will be removed after 2020-07-31.")
- userClearPrivateMetadata(id: ID!, input: MetaPath!): UserClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation. This field will be removed after 2020-07-31.")
serviceAccountCreate(input: ServiceAccountInput!): ServiceAccountCreate @deprecated(reason: "Use the `appCreate` mutation instead. This field will be removed after 2020-07-31.")
serviceAccountUpdate(id: ID!, input: ServiceAccountInput!): ServiceAccountUpdate @deprecated(reason: "Use the `appUpdate` mutation instead. This field will be removed after 2020-07-31.")
serviceAccountDelete(id: ID!): ServiceAccountDelete @deprecated(reason: "Use the `appDelete` mutation instead. This field will be removed after 2020-07-31.")
- serviceAccountUpdatePrivateMetadata(id: ID!, input: MetaInput!): ServiceAccountUpdatePrivateMeta @deprecated(reason: "Use the `updatePrivateMetadata` mutation with App instead.This field will be removed after 2020-07-31.")
- serviceAccountClearPrivateMetadata(id: ID!, input: MetaPath!): ServiceAccountClearPrivateMeta @deprecated(reason: "Use the `deletePrivateMetadata` mutation with App instead.This field will be removed after 2020-07-31.")
serviceAccountTokenCreate(input: ServiceAccountTokenInput!): ServiceAccountTokenCreate @deprecated(reason: "Use the `appTokenCreate` mutation instead. This field will be removed after 2020-07-31.")
serviceAccountTokenDelete(id: ID!): ServiceAccountTokenDelete @deprecated(reason: "Use the `appTokenDelete` mutation instead. This field will be removed after 2020-07-31.")
permissionGroupCreate(input: PermissionGroupCreateInput!): PermissionGroupCreate
@@ -2869,8 +2660,6 @@ interface Node {
interface ObjectWithMetadata {
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
}
type Order implements Node & ObjectWithMetadata {
@@ -2896,8 +2685,6 @@ type Order implements Node & ObjectWithMetadata {
weight: Weight
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
fulfillments: [Fulfillment]!
lines: [OrderLine]!
actions: [OrderAction]!
@@ -2956,16 +2743,6 @@ type OrderCapture {
orderErrors: [OrderError!]!
}
-type OrderClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- order: Order
-}
-
-type OrderClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- order: Order
-}
-
type OrderCountableConnection {
pageInfo: PageInfo!
edges: [OrderCountableEdge!]!
@@ -3216,16 +2993,6 @@ input OrderUpdateInput {
shippingAddress: AddressInput
}
-type OrderUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- order: Order
-}
-
-type OrderUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- order: Order
-}
-
type OrderUpdateShipping {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
@@ -3255,8 +3022,6 @@ type Page implements Node & ObjectWithMetadata {
created: DateTime!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
translation(languageCode: LanguageCodeEnum!): PageTranslation
}
@@ -3666,8 +3431,6 @@ type Product implements Node & ObjectWithMetadata {
defaultVariant: ProductVariant
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
url: String! @deprecated(reason: "This field will be removed after 2020-07-31.")
thumbnail(size: Int): Image
pricing: ProductPricingInfo
@@ -3697,18 +3460,6 @@ type ProductBulkPublish {
productErrors: [ProductError!]!
}
-type ProductClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- product: Product
-}
-
-type ProductClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- product: Product
-}
-
type ProductCountableConnection {
pageInfo: PageInfo!
edges: [ProductCountableEdge!]!
@@ -3956,8 +3707,6 @@ type ProductType implements Node & ObjectWithMetadata {
weight: Weight
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
products(before: String, after: String, first: Int, last: Int): ProductCountableConnection
taxRate: TaxRateType
taxType: TaxType
@@ -3972,18 +3721,6 @@ type ProductTypeBulkDelete {
productErrors: [ProductError!]!
}
-type ProductTypeClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productType: ProductType
-}
-
-type ProductTypeClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productType: ProductType
-}
-
enum ProductTypeConfigurable {
CONFIGURABLE
SIMPLE
@@ -4059,36 +3796,12 @@ type ProductTypeUpdate {
productType: ProductType
}
-type ProductTypeUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productType: ProductType
-}
-
-type ProductTypeUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productType: ProductType
-}
-
type ProductUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
productErrors: [ProductError!]!
product: Product
}
-type ProductUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- product: Product
-}
-
-type ProductUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- product: Product
-}
-
type ProductVariant implements Node & ObjectWithMetadata {
id: ID!
name: String!
@@ -4098,8 +3811,6 @@ type ProductVariant implements Node & ObjectWithMetadata {
weight: Weight
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
quantity: Int! @deprecated(reason: "Use the stock field instead. This field will be removed after 2020-07-31.")
quantityAllocated: Int @deprecated(reason: "Use the stock field instead. This field will be removed after 2020-07-31.")
stockQuantity: Int! @deprecated(reason: "Use the quantityAvailable field instead. This field will be removed after 2020-07-31.")
@@ -4141,18 +3852,6 @@ type ProductVariantBulkDelete {
productErrors: [ProductError!]!
}
-type ProductVariantClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productVariant: ProductVariant
-}
-
-type ProductVariantClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productVariant: ProductVariant
-}
-
type ProductVariantCountableConnection {
pageInfo: PageInfo!
edges: [ProductVariantCountableEdge!]!
@@ -4256,18 +3955,6 @@ type ProductVariantUpdate {
productVariant: ProductVariant
}
-type ProductVariantUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productVariant: ProductVariant
-}
-
-type ProductVariantUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- productErrors: [ProductError!]!
- productVariant: ProductVariant
-}
-
type Query {
webhook(id: ID!): Webhook
webhooks(sortBy: WebhookSortingInput, filter: WebhookFilterInput, before: String, after: String, first: Int, last: Int): WebhookCountableConnection @deprecated(reason: "Use webhooks field on app(s) query instead. This field will be removed after 2020-07-31.")
@@ -4510,14 +4197,6 @@ type ServiceAccount implements Node & ObjectWithMetadata {
tokens: [ServiceAccountToken]
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
-}
-
-type ServiceAccountClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- serviceAccount: ServiceAccount
}
type ServiceAccountCountableConnection {
@@ -4595,12 +4274,6 @@ type ServiceAccountUpdate {
serviceAccount: ServiceAccount
}
-type ServiceAccountUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- serviceAccount: ServiceAccount
-}
-
type SetPassword {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
token: String
@@ -4638,8 +4311,6 @@ type ShippingMethod implements Node & ObjectWithMetadata {
maximumOrderWeight: Weight
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
type: ShippingMethodTypeEnum
translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation
}
@@ -4712,8 +4383,6 @@ type ShippingZone implements Node & ObjectWithMetadata {
default: Boolean!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
priceRange: MoneyRange
countries: [CountryDisplay]
shippingMethods: [ShippingMethod]
@@ -5188,8 +4857,6 @@ type User implements Node & ObjectWithMetadata {
defaultBillingAddress: Address
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
- privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
- meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
addresses: [Address]
checkout: Checkout
giftCards(before: String, after: String, first: Int, last: Int): GiftCardCountableConnection
@@ -5221,18 +4888,6 @@ type UserBulkSetActive {
accountErrors: [AccountError!]!
}
-type UserClearMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- user: User
-}
-
-type UserClearPrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- user: User
-}
-
type UserCountableConnection {
pageInfo: PageInfo!
edges: [UserCountableEdge!]!
@@ -5273,18 +4928,6 @@ input UserSortingInput {
field: UserSortField!
}
-type UserUpdateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- user: User
-}
-
-type UserUpdatePrivateMeta {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- accountErrors: [AccountError!]!
- user: User
-}
-
type VAT {
countryCode: String!
standardRate: Float
diff --git a/saleor/graphql/shipping/types.py b/saleor/graphql/shipping/types.py
index d4b618498b..0a657f2dbb 100644
--- a/saleor/graphql/shipping/types.py
+++ b/saleor/graphql/shipping/types.py
@@ -1,14 +1,10 @@
import graphene
from graphene import relay
-from saleor.core.permissions import ShippingPermissions
-
from ...core.weight import convert_weight_to_default_weight_unit
from ...shipping import models
from ..core.connection import CountableDjangoObjectType
from ..core.types import CountryDisplay, MoneyRange
-from ..decorators import permission_required
-from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..translations.fields import TranslationField
from ..translations.types import ShippingMethodTranslation
@@ -47,15 +43,6 @@ class ShippingMethod(CountableDjangoObjectType):
def resolve_minimum_order_weight(root: models.ShippingMethod, *_args):
return convert_weight_to_default_weight_unit(root.minimum_order_weight)
- @staticmethod
- @permission_required(ShippingPermissions.MANAGE_SHIPPING)
- def resolve_private_meta(root: models.ShippingMethod, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.ShippingMethod, _info):
- return resolve_meta(root, _info)
-
class ShippingZone(CountableDjangoObjectType):
price_range = graphene.Field(
@@ -103,12 +90,3 @@ class ShippingZone(CountableDjangoObjectType):
@staticmethod
def resolve_warehouses(root: models.ShippingZone, *_args):
return root.warehouses.all()
-
- @staticmethod
- @permission_required(ShippingPermissions.MANAGE_SHIPPING)
- def resolve_private_meta(root: models.ShippingZone, _info):
- return resolve_private_meta(root, _info)
-
- @staticmethod
- def resolve_meta(root: models.ShippingZone, _info):
- return resolve_meta(root, _info)