Skip to content

Commit

Permalink
Add missing description to page types (saleor#13536)
Browse files Browse the repository at this point in the history
* Added missing description to page types.

* Fixed schema

* updated changelog
  • Loading branch information
DevilsAutumn authored Jul 27, 2023
1 parent 4c0022e commit 6981187
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Shipping methods can be removed by the user after it has been assigned to a chec
- Fix error handling in the permission check for `Query.webhook` - #13378 by @patrys
- Add missing descriptions to Translation module. - #13410 by @Smit-Parmar
- Add missing descriptions to menu module - #13409 by @devilsautumn
- Add missing descriptions to page module - #13536 by @devilsautumn

# 3.14.0

Expand Down
28 changes: 17 additions & 11 deletions saleor/graphql/page/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

@federated_entity("id")
class PageType(ModelObjectType[models.PageType]):
id = graphene.GlobalID(required=True)
name = graphene.String(required=True)
slug = graphene.String(required=True)
id = graphene.GlobalID(required=True, description="ID of the page type.")
name = graphene.String(required=True, description="Name of the page type.")
slug = graphene.String(required=True, description="Slug of the page type.")
attributes = NonNullList(
Attribute, description="Page attributes of that page type."
)
Expand Down Expand Up @@ -103,10 +103,10 @@ class Meta:


class Page(ModelObjectType[models.Page]):
id = graphene.GlobalID(required=True)
seo_title = graphene.String()
seo_description = graphene.String()
title = graphene.String(required=True)
id = graphene.GlobalID(required=True, description="ID of the page.")
seo_title = graphene.String(description="Title of the page for SEO.")
seo_description = graphene.String(description="Description of the page for SEO.")
title = graphene.String(required=True, description="Title of the page.")
content = JSONString(description="Content of the page." + RICH_CONTENT)
publication_date = Date(
deprecation_reason=(
Expand All @@ -117,10 +117,16 @@ class Page(ModelObjectType[models.Page]):
published_at = graphene.DateTime(
description="The page publication date." + ADDED_IN_33
)
is_published = graphene.Boolean(required=True)
slug = graphene.String(required=True)
page_type = graphene.Field(PageType, required=True)
created = graphene.DateTime(required=True)
is_published = graphene.Boolean(
required=True, description="Determines if the page is published."
)
slug = graphene.String(required=True, description="Slug of the page.")
page_type = graphene.Field(
PageType, required=True, description="Determines the type of page"
)
created = graphene.DateTime(
required=True, description="Date and time at which page was created."
)
content_json = JSONString(
description="Content of the page." + RICH_CONTENT,
deprecation_reason=f"{DEPRECATED_IN_3X_FIELD} Use the `content` field instead.",
Expand Down
20 changes: 20 additions & 0 deletions saleor/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8328,6 +8328,7 @@ type PageTranslation implements Node @doc(category: "Pages") {
A static page that can be manually added by a shop operator through the dashboard.
"""
type Page implements Node & ObjectWithMetadata @doc(category: "Pages") {
"""ID of the page."""
id: ID!

"""List of private metadata items. Requires staff permissions to access."""
Expand Down Expand Up @@ -8367,8 +8368,14 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") {
Added in Saleor 3.3.
"""
metafields(keys: [String!]): Metadata

"""Title of the page for SEO."""
seoTitle: String

"""Description of the page for SEO."""
seoDescription: String

"""Title of the page."""
title: String!

"""
Expand All @@ -8385,9 +8392,17 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") {
Added in Saleor 3.3.
"""
publishedAt: DateTime

"""Determines if the page is published."""
isPublished: Boolean!

"""Slug of the page."""
slug: String!

"""Determines the type of page"""
pageType: PageType!

"""Date and time at which page was created."""
created: DateTime!

"""
Expand All @@ -8411,6 +8426,7 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") {
Represents a type of page. It defines what attributes are available to pages of this type.
"""
type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") {
"""ID of the page type."""
id: ID!

"""List of private metadata items. Requires staff permissions to access."""
Expand Down Expand Up @@ -8450,7 +8466,11 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") {
Added in Saleor 3.3.
"""
metafields(keys: [String!]): Metadata

"""Name of the page type."""
name: String!

"""Slug of the page type."""
slug: String!

"""Page attributes of that page type."""
Expand Down

0 comments on commit 6981187

Please sign in to comment.