Skip to content

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

Make new boolean fields non-nullable

NyanKiyoshi337ca3251c63
diff --git a/saleor/graphql/product/types/attributes.py b/saleor/graphql/product/types/attributes.py
index 1ec0e4a44c..dae3e66cbe 100644
--- a/saleor/graphql/product/types/attributes.py
+++ b/saleor/graphql/product/types/attributes.py
@@ -97,18 +97,20 @@ class Attribute(CountableDjangoObjectType, MetadataObjectType):
model_field="values",
)
- value_required = graphene.Boolean(description=AttributeDescriptions.VALUE_REQUIRED)
+ value_required = graphene.Boolean(
+ description=AttributeDescriptions.VALUE_REQUIRED, required=True
+ )
visible_in_storefront = graphene.Boolean(
- description=AttributeDescriptions.VISIBLE_IN_STOREFRONT
+ description=AttributeDescriptions.VISIBLE_IN_STOREFRONT, required=True
)
filterable_in_storefront = graphene.Boolean(
- description=AttributeDescriptions.FILTERABLE_IN_STOREFRONT
+ description=AttributeDescriptions.FILTERABLE_IN_STOREFRONT, required=True
)
filterable_in_dashboard = graphene.Boolean(
- description=AttributeDescriptions.FILTERABLE_IN_DASHBOARD
+ description=AttributeDescriptions.FILTERABLE_IN_DASHBOARD, required=True
)
available_in_grid = graphene.Boolean(
- description=AttributeDescriptions.AVAILABLE_IN_GRID
+ description=AttributeDescriptions.AVAILABLE_IN_GRID, required=True
)
translation = graphene.Field(
@@ -125,7 +127,7 @@ class Attribute(CountableDjangoObjectType, MetadataObjectType):
)
storefront_search_position = graphene.Int(
- description=AttributeDescriptions.STOREFRONT_SEARCH_POSITION
+ description=AttributeDescriptions.STOREFRONT_SEARCH_POSITION, required=True
)
class Meta:
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 905ef27989..dd76af83c8 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -151,13 +151,13 @@ type Attribute implements Node {
name: String
slug: String
values: [AttributeValue]
- valueRequired: Boolean
- visibleInStorefront: Boolean
- filterableInStorefront: Boolean
- filterableInDashboard: Boolean
- availableInGrid: Boolean
+ valueRequired: Boolean!
+ visibleInStorefront: Boolean!
+ filterableInStorefront: Boolean!
+ filterableInDashboard: Boolean!
+ availableInGrid: Boolean!
translation(languageCode: LanguageCodeEnum!): AttributeTranslation
- storefrontSearchPosition: Int
+ storefrontSearchPosition: Int!
}
type AttributeAssign {