+
+ )
}
+
+export default PopularPostSection
diff --git a/app/posts/[postId]/page.tsx b/app/posts/[postId]/page.tsx
new file mode 100644
index 0000000..7741708
--- /dev/null
+++ b/app/posts/[postId]/page.tsx
@@ -0,0 +1,42 @@
+import { getClient } from '@/apollo/client'
+import { PostDocument, type PostQuery } from '@/graphql/types-and-hooks'
+import { notFound } from 'next/navigation'
+import { cache, type FC } from 'react'
+
+const queryPost = cache(async (postId: number) => {
+ const client = getClient()
+
+ const { data } = await client.query({
+ query: PostDocument,
+ variables: {
+ postId,
+ },
+ })
+
+ return data
+})
+
+
+
+export interface PostIdPageProps {
+ params: {
+ postId: string
+ }
+ searchParams: {
+ preview?: string
+ }
+}
+
+const PostIdPage: FC = async ({ params: { postId } }) => {
+ if (!postId || isNaN(+postId)) {
+ notFound()
+ }
+
+ const { post } = await queryPost(+postId)
+
+
+ return
+}
+
+
+export default PostIdPage
diff --git a/codegen.yml b/codegen.yml
new file mode 100644
index 0000000..9bb5889
--- /dev/null
+++ b/codegen.yml
@@ -0,0 +1,12 @@
+schema:
+ - https://very.icook.tw/graphql:
+ headers:
+ user-agent: "JS GraphQL"
+documents:
+ - "./**/*.graphql"
+generates:
+ ./graphql/types-and-hooks.tsx:
+ plugins:
+ - typescript
+ - typescript-operations
+ - typescript-react-apollo
diff --git a/graphql/post.graphql b/graphql/post.graphql
new file mode 100644
index 0000000..b173c6d
--- /dev/null
+++ b/graphql/post.graphql
@@ -0,0 +1,113 @@
+query Post($postId: ID!) {
+ post(id: $postId, idType: DATABASE_ID) {
+ date
+ modified
+ title
+ status
+ content
+ databaseId
+ excerpt
+ featuredImage {
+ node {
+ mediaItemUrl
+ }
+ }
+ author {
+ node {
+ description
+ name
+ nickname
+ slug
+ facebook
+ instagram
+ avatar {
+ url
+ }
+ }
+ }
+ categories {
+ nodes {
+ name
+ slug
+ }
+ }
+ tags {
+ nodes {
+ name
+ slug
+ }
+ }
+ }
+}
+
+query Posts(
+ $first: Int
+ $categoryName: String
+ $authorName: String
+ $includeExcerpt: Boolean = false
+ $includePageInfo: Boolean = false
+ $in: [ID]
+ $notIn: [ID]
+ $tagSlug: [String]
+ $searchKeyword: String
+ $after: String
+ $includeDetails: Boolean = false
+ $orderBy: PostObjectsConnectionOrderbyEnum = DATE
+) {
+ posts(
+ where: {
+ orderby: { field: $orderBy, order: DESC }
+ categoryName: $categoryName
+ authorName: $authorName
+ in: $in
+ notIn: $notIn
+ tagSlugIn: $tagSlug
+ search: $searchKeyword
+ }
+ first: $first
+ after: $after
+ ) {
+ nodes {
+ excerpt @include(if: $includeExcerpt)
+ content @include(if: $includeDetails)
+ author @include(if: $includeDetails) {
+ node {
+ name
+ nickname
+ slug
+ description
+ avatar {
+ url
+ }
+ }
+ }
+ date @include(if: $includeDetails)
+ modified @include(if: $includeDetails)
+ tags {
+ nodes {
+ id
+ name
+ slug
+ }
+ }
+ categories {
+ nodes {
+ id
+ slug
+ name
+ }
+ }
+ databaseId
+ title
+ featuredImage {
+ node {
+ mediaItemUrl
+ }
+ }
+ }
+ pageInfo @include(if: $includePageInfo) {
+ endCursor
+ hasNextPage
+ }
+ }
+}
diff --git a/graphql/types-and-hooks.tsx b/graphql/types-and-hooks.tsx
new file mode 100644
index 0000000..4c5574a
--- /dev/null
+++ b/graphql/types-and-hooks.tsx
@@ -0,0 +1,11212 @@
+import * as Apollo from '@apollo/client';
+import { gql } from '@apollo/client';
+export type Maybe = T | null;
+export type InputMaybe = Maybe;
+export type Exact = { [K in keyof T]: T[K] };
+export type MakeOptional = Omit & { [SubKey in K]?: Maybe };
+export type MakeMaybe = Omit & { [SubKey in K]: Maybe };
+export type MakeEmpty = { [_ in K]?: never };
+export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
+const defaultOptions = {} as const;
+/** All built-in and custom scalars, mapped to their actual values */
+export type Scalars = {
+ ID: { input: string; output: string; }
+ String: { input: string; output: string; }
+ Boolean: { input: boolean; output: boolean; }
+ Int: { input: number; output: number; }
+ Float: { input: number; output: number; }
+};
+
+/** Avatars are profile images for users. WordPress by default uses the Gravatar service to host and fetch avatars from. */
+export type Avatar = {
+ __typename?: 'Avatar';
+ /** URL for the default image or a default type. Accepts '404' (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the 'quilt'), 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 'gravatar_default' (the Gravatar logo). */
+ default?: Maybe;
+ /** HTML attributes to insert in the IMG element. Is not sanitized. */
+ extraAttr?: Maybe;
+ /** Whether to always show the default image, never the Gravatar. */
+ forceDefault?: Maybe;
+ /** Whether the avatar was successfully found. */
+ foundAvatar?: Maybe;
+ /** Height of the avatar image. */
+ height?: Maybe;
+ /** Whether the object is restricted from the current viewer */
+ isRestricted?: Maybe;
+ /** What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order. */
+ rating?: Maybe;
+ /** Type of url scheme to use. Typically HTTP vs. HTTPS. */
+ scheme?: Maybe;
+ /** The size of the avatar in pixels. A value of 96 will match a 96px x 96px gravatar image. */
+ size?: Maybe;
+ /** URL for the gravatar image source. */
+ url?: Maybe;
+ /** Width of the avatar image. */
+ width?: Maybe;
+};
+
+/** What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order. Default is the value of the 'avatar_rating' option */
+export enum AvatarRatingEnum {
+ /** Indicates a G level avatar rating level. */
+ G = 'G',
+ /** Indicates a PG level avatar rating level. */
+ Pg = 'PG',
+ /** Indicates an R level avatar rating level. */
+ R = 'R',
+ /** Indicates an X level avatar rating level. */
+ X = 'X'
+}
+
+/** The category type */
+export type Category = DatabaseIdentifier & HierarchicalNode & HierarchicalTermNode & MenuItemLinkable & Node & TermNode & UniformResourceIdentifiable & {
+ __typename?: 'Category';
+ /** The ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root). */
+ ancestors?: Maybe;
+ /**
+ * The id field matches the WP_Post->ID field.
+ * @deprecated Deprecated in favor of databaseId
+ */
+ categoryId?: Maybe;
+ /** Connection between the category type and its children categories. */
+ children?: Maybe;
+ /** Connection between the Category type and the ContentNode type */
+ contentNodes?: Maybe;
+ /** The number of objects connected to the object */
+ count?: Maybe;
+ /** The unique identifier stored in the database */
+ databaseId: Scalars['Int']['output'];
+ /** The description of the object */
+ description?: Maybe;
+ /** Connection between the TermNode type and the EnqueuedScript type */
+ enqueuedScripts?: Maybe;
+ /** Connection between the TermNode type and the EnqueuedStylesheet type */
+ enqueuedStylesheets?: Maybe;
+ /** The unique resource identifier path */
+ id: Scalars['ID']['output'];
+ /** Whether the node is a Content Node */
+ isContentNode: Scalars['Boolean']['output'];
+ /** Whether the object is restricted from the current viewer */
+ isRestricted?: Maybe;
+ /** Whether the node is a Term */
+ isTermNode: Scalars['Boolean']['output'];
+ /** The link to the term */
+ link?: Maybe;
+ /** The human friendly name of the object. */
+ name?: Maybe;
+ /** Connection between the category type and its parent category. */
+ parent?: Maybe;
+ /** Database id of the parent node */
+ parentDatabaseId?: Maybe;
+ /** The globally unique identifier of the parent node. */
+ parentId?: Maybe;
+ /** Connection between the Category type and the post type */
+ posts?: Maybe;
+ /** The Yoast SEO data of the 分類 taxonomy. */
+ seo?: Maybe;
+ /** An alphanumeric identifier for the object unique to its type. */
+ slug?: Maybe;
+ /** Connection between the Category type and the Taxonomy type */
+ taxonomy?: Maybe;
+ /** The name of the taxonomy that the object is associated with */
+ taxonomyName?: Maybe;
+ /** The ID of the term group that this term object belongs to */
+ termGroupId?: Maybe;
+ /** The taxonomy ID that the object is associated with */
+ termTaxonomyId?: Maybe;
+ /** The unique resource identifier path */
+ uri?: Maybe;
+};
+
+
+/** The category type */
+export type CategoryAncestorsArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+};
+
+
+/** The category type */
+export type CategoryChildrenArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+ where?: InputMaybe;
+};
+
+
+/** The category type */
+export type CategoryContentNodesArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+ where?: InputMaybe;
+};
+
+
+/** The category type */
+export type CategoryEnqueuedScriptsArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+};
+
+
+/** The category type */
+export type CategoryEnqueuedStylesheetsArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+};
+
+
+/** The category type */
+export type CategoryPostsArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+ where?: InputMaybe;
+};
+
+/** Connection to category Nodes */
+export type CategoryConnection = {
+ /** A list of edges (relational context) between RootQuery and connected category Nodes */
+ edges: Array;
+ /** A list of connected category Nodes */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CategoryConnectionPageInfo;
+};
+
+/** Edge between a Node and a connected category */
+export type CategoryConnectionEdge = {
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The connected category Node */
+ node: Category;
+};
+
+/** Page Info on the connected CategoryConnectionEdge */
+export type CategoryConnectionPageInfo = {
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** The Type of Identifier used to fetch a single resource. Default is ID. */
+export enum CategoryIdType {
+ /** The Database ID for the node */
+ DatabaseId = 'DATABASE_ID',
+ /** The hashed Global ID */
+ Id = 'ID',
+ /** The name of the node */
+ Name = 'NAME',
+ /** Url friendly name of the node */
+ Slug = 'SLUG',
+ /** The URI for the node */
+ Uri = 'URI'
+}
+
+/** Connection between the Category type and the category type */
+export type CategoryToAncestorsCategoryConnection = CategoryConnection & Connection & {
+ __typename?: 'CategoryToAncestorsCategoryConnection';
+ /** Edges for the CategoryToAncestorsCategoryConnection connection */
+ edges: Array;
+ /** The nodes of the connection, without the edges */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CategoryToAncestorsCategoryConnectionPageInfo;
+};
+
+/** An edge in a connection */
+export type CategoryToAncestorsCategoryConnectionEdge = CategoryConnectionEdge & Edge & {
+ __typename?: 'CategoryToAncestorsCategoryConnectionEdge';
+ /** A cursor for use in pagination */
+ cursor?: Maybe;
+ /** The item at the end of the edge */
+ node: Category;
+};
+
+/** Page Info on the "CategoryToAncestorsCategoryConnection" */
+export type CategoryToAncestorsCategoryConnectionPageInfo = CategoryConnectionPageInfo & PageInfo & WpPageInfo & {
+ __typename?: 'CategoryToAncestorsCategoryConnectionPageInfo';
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** Connection between the Category type and the category type */
+export type CategoryToCategoryConnection = CategoryConnection & Connection & {
+ __typename?: 'CategoryToCategoryConnection';
+ /** Edges for the CategoryToCategoryConnection connection */
+ edges: Array;
+ /** The nodes of the connection, without the edges */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CategoryToCategoryConnectionPageInfo;
+};
+
+/** An edge in a connection */
+export type CategoryToCategoryConnectionEdge = CategoryConnectionEdge & Edge & {
+ __typename?: 'CategoryToCategoryConnectionEdge';
+ /** A cursor for use in pagination */
+ cursor?: Maybe;
+ /** The item at the end of the edge */
+ node: Category;
+};
+
+/** Page Info on the "CategoryToCategoryConnection" */
+export type CategoryToCategoryConnectionPageInfo = CategoryConnectionPageInfo & PageInfo & WpPageInfo & {
+ __typename?: 'CategoryToCategoryConnectionPageInfo';
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** Arguments for filtering the CategoryToCategoryConnection connection */
+export type CategoryToCategoryConnectionWhereArgs = {
+ /** Unique cache key to be produced when this query is stored in an object cache. Default is 'core'. */
+ cacheDomain?: InputMaybe;
+ /** Term ID to retrieve child terms of. If multiple taxonomies are passed, $child_of is ignored. Default 0. */
+ childOf?: InputMaybe;
+ /** True to limit results to terms that have no children. This parameter has no effect on non-hierarchical taxonomies. Default false. */
+ childless?: InputMaybe;
+ /** Retrieve terms where the description is LIKE the input value. Default empty. */
+ descriptionLike?: InputMaybe;
+ /** Array of term ids to exclude. If $include is non-empty, $exclude is ignored. Default empty array. */
+ exclude?: InputMaybe>>;
+ /** Array of term ids to exclude along with all of their descendant terms. If $include is non-empty, $exclude_tree is ignored. Default empty array. */
+ excludeTree?: InputMaybe>>;
+ /** Whether to hide terms not assigned to any posts. Accepts true or false. Default false */
+ hideEmpty?: InputMaybe;
+ /** Whether to include terms that have non-empty descendants (even if $hide_empty is set to true). Default true. */
+ hierarchical?: InputMaybe;
+ /** Array of term ids to include. Default empty array. */
+ include?: InputMaybe>>;
+ /** Array of names to return term(s) for. Default empty. */
+ name?: InputMaybe>>;
+ /** Retrieve terms where the name is LIKE the input value. Default empty. */
+ nameLike?: InputMaybe;
+ /** Array of object IDs. Results will be limited to terms associated with these objects. */
+ objectIds?: InputMaybe>>;
+ /** Direction the connection should be ordered in */
+ order?: InputMaybe;
+ /** Field(s) to order terms by. Defaults to 'name'. */
+ orderby?: InputMaybe;
+ /** Whether to pad the quantity of a term's children in the quantity of each term's "count" object variable. Default false. */
+ padCounts?: InputMaybe;
+ /** Parent term ID to retrieve direct-child terms of. Default empty. */
+ parent?: InputMaybe;
+ /** Search criteria to match terms. Will be SQL-formatted with wildcards before and after. Default empty. */
+ search?: InputMaybe;
+ /** Array of slugs to return term(s) for. Default empty. */
+ slug?: InputMaybe>>;
+ /** Array of term taxonomy IDs, to match when querying terms. */
+ termTaxonomId?: InputMaybe>>;
+ /** Array of term taxonomy IDs, to match when querying terms. */
+ termTaxonomyId?: InputMaybe>>;
+ /** Whether to prime meta caches for matched terms. Default true. */
+ updateTermMetaCache?: InputMaybe;
+};
+
+/** Connection between the Category type and the ContentNode type */
+export type CategoryToContentNodeConnection = Connection & ContentNodeConnection & {
+ __typename?: 'CategoryToContentNodeConnection';
+ /** Edges for the CategoryToContentNodeConnection connection */
+ edges: Array;
+ /** The nodes of the connection, without the edges */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CategoryToContentNodeConnectionPageInfo;
+};
+
+/** An edge in a connection */
+export type CategoryToContentNodeConnectionEdge = ContentNodeConnectionEdge & Edge & {
+ __typename?: 'CategoryToContentNodeConnectionEdge';
+ /** A cursor for use in pagination */
+ cursor?: Maybe;
+ /** The item at the end of the edge */
+ node: ContentNode;
+};
+
+/** Page Info on the "CategoryToContentNodeConnection" */
+export type CategoryToContentNodeConnectionPageInfo = ContentNodeConnectionPageInfo & PageInfo & WpPageInfo & {
+ __typename?: 'CategoryToContentNodeConnectionPageInfo';
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** Arguments for filtering the CategoryToContentNodeConnection connection */
+export type CategoryToContentNodeConnectionWhereArgs = {
+ /** The Types of content to filter */
+ contentTypes?: InputMaybe>>;
+ /** Filter the connection based on dates */
+ dateQuery?: InputMaybe;
+ /** True for objects with passwords; False for objects without passwords; null for all objects with or without passwords */
+ hasPassword?: InputMaybe;
+ /** Specific database ID of the object */
+ id?: InputMaybe;
+ /** Array of IDs for the objects to retrieve */
+ in?: InputMaybe>>;
+ /** Get objects with a specific mimeType property */
+ mimeType?: InputMaybe;
+ /** Slug / post_name of the object */
+ name?: InputMaybe;
+ /** Specify objects to retrieve. Use slugs */
+ nameIn?: InputMaybe>>;
+ /** Specify IDs NOT to retrieve. If this is used in the same query as "in", it will be ignored */
+ notIn?: InputMaybe>>;
+ /** What parameter to use to order the objects by. */
+ orderby?: InputMaybe>>;
+ /** Use ID to return only children. Use 0 to return only top-level items */
+ parent?: InputMaybe;
+ /** Specify objects whose parent is in an array */
+ parentIn?: InputMaybe>>;
+ /** Specify posts whose parent is not in an array */
+ parentNotIn?: InputMaybe>>;
+ /** Show posts with a specific password. */
+ password?: InputMaybe;
+ /** Show Posts based on a keyword search */
+ search?: InputMaybe;
+ /** Retrieve posts where post status is in an array. */
+ stati?: InputMaybe>>;
+ /** Show posts with a specific status. */
+ status?: InputMaybe;
+ /** Title of the object */
+ title?: InputMaybe;
+};
+
+/** Connection between the Category type and the category type */
+export type CategoryToParentCategoryConnectionEdge = CategoryConnectionEdge & Edge & OneToOneConnection & {
+ __typename?: 'CategoryToParentCategoryConnectionEdge';
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The node of the connection, without the edges */
+ node: Category;
+};
+
+/** Connection between the Category type and the post type */
+export type CategoryToPostConnection = Connection & PostConnection & {
+ __typename?: 'CategoryToPostConnection';
+ /** Edges for the CategoryToPostConnection connection */
+ edges: Array;
+ /** The nodes of the connection, without the edges */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CategoryToPostConnectionPageInfo;
+};
+
+/** An edge in a connection */
+export type CategoryToPostConnectionEdge = Edge & PostConnectionEdge & {
+ __typename?: 'CategoryToPostConnectionEdge';
+ /** A cursor for use in pagination */
+ cursor?: Maybe;
+ /** The item at the end of the edge */
+ node: Post;
+};
+
+/** Page Info on the "CategoryToPostConnection" */
+export type CategoryToPostConnectionPageInfo = PageInfo & PostConnectionPageInfo & WpPageInfo & {
+ __typename?: 'CategoryToPostConnectionPageInfo';
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** Arguments for filtering the CategoryToPostConnection connection */
+export type CategoryToPostConnectionWhereArgs = {
+ /** The user that's connected as the author of the object. Use the userId for the author object. */
+ author?: InputMaybe;
+ /** Find objects connected to author(s) in the array of author's userIds */
+ authorIn?: InputMaybe>>;
+ /** Find objects connected to the author by the author's nicename */
+ authorName?: InputMaybe;
+ /** Find objects NOT connected to author(s) in the array of author's userIds */
+ authorNotIn?: InputMaybe>>;
+ /** Category ID */
+ categoryId?: InputMaybe;
+ /** Array of category IDs, used to display objects from one category OR another */
+ categoryIn?: InputMaybe>>;
+ /** Use Category Slug */
+ categoryName?: InputMaybe;
+ /** Array of category IDs, used to display objects from one category OR another */
+ categoryNotIn?: InputMaybe>>;
+ /** Filter the connection based on dates */
+ dateQuery?: InputMaybe;
+ /** True for objects with passwords; False for objects without passwords; null for all objects with or without passwords */
+ hasPassword?: InputMaybe;
+ /** Specific database ID of the object */
+ id?: InputMaybe;
+ /** Array of IDs for the objects to retrieve */
+ in?: InputMaybe>>;
+ /** Get objects with a specific mimeType property */
+ mimeType?: InputMaybe;
+ /** Slug / post_name of the object */
+ name?: InputMaybe;
+ /** Specify objects to retrieve. Use slugs */
+ nameIn?: InputMaybe>>;
+ /** Specify IDs NOT to retrieve. If this is used in the same query as "in", it will be ignored */
+ notIn?: InputMaybe>>;
+ /** What parameter to use to order the objects by. */
+ orderby?: InputMaybe>>;
+ /** Use ID to return only children. Use 0 to return only top-level items */
+ parent?: InputMaybe;
+ /** Specify objects whose parent is in an array */
+ parentIn?: InputMaybe>>;
+ /** Specify posts whose parent is not in an array */
+ parentNotIn?: InputMaybe>>;
+ /** Show posts with a specific password. */
+ password?: InputMaybe;
+ /** Show Posts based on a keyword search */
+ search?: InputMaybe;
+ /** Retrieve posts where post status is in an array. */
+ stati?: InputMaybe>>;
+ /** Show posts with a specific status. */
+ status?: InputMaybe;
+ /** Tag Slug */
+ tag?: InputMaybe;
+ /** Use Tag ID */
+ tagId?: InputMaybe;
+ /** Array of tag IDs, used to display objects from one tag OR another */
+ tagIn?: InputMaybe>>;
+ /** Array of tag IDs, used to display objects from one tag OR another */
+ tagNotIn?: InputMaybe>>;
+ /** Array of tag slugs, used to display objects from one tag AND another */
+ tagSlugAnd?: InputMaybe>>;
+ /** Array of tag slugs, used to include objects in ANY specified tags */
+ tagSlugIn?: InputMaybe>>;
+ /** Title of the object */
+ title?: InputMaybe;
+};
+
+/** Connection between the Category type and the Taxonomy type */
+export type CategoryToTaxonomyConnectionEdge = Edge & OneToOneConnection & TaxonomyConnectionEdge & {
+ __typename?: 'CategoryToTaxonomyConnectionEdge';
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The node of the connection, without the edges */
+ node: Taxonomy;
+};
+
+/** A Comment object */
+export type Comment = DatabaseIdentifier & Node & {
+ __typename?: 'Comment';
+ /** User agent used to post the comment. This field is equivalent to WP_Comment->comment_agent and the value matching the "comment_agent" column in SQL. */
+ agent?: Maybe;
+ /**
+ * The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL.
+ * @deprecated Deprecated in favor of the `status` field
+ */
+ approved?: Maybe;
+ /** The author of the comment */
+ author?: Maybe;
+ /** IP address for the author. This field is equivalent to WP_Comment->comment_author_IP and the value matching the "comment_author_IP" column in SQL. */
+ authorIp?: Maybe;
+ /**
+ * ID for the comment, unique among comments.
+ * @deprecated Deprecated in favor of databaseId
+ */
+ commentId?: Maybe;
+ /** Connection between the Comment type and the ContentNode type */
+ commentedOn?: Maybe;
+ /** Content of the comment. This field is equivalent to WP_Comment->comment_content and the value matching the "comment_content" column in SQL. */
+ content?: Maybe;
+ /** The unique identifier stored in the database */
+ databaseId: Scalars['Int']['output'];
+ /** Date the comment was posted in local time. This field is equivalent to WP_Comment->date and the value matching the "date" column in SQL. */
+ date?: Maybe;
+ /** Date the comment was posted in GMT. This field is equivalent to WP_Comment->date_gmt and the value matching the "date_gmt" column in SQL. */
+ dateGmt?: Maybe;
+ /** The globally unique identifier for the comment object */
+ id: Scalars['ID']['output'];
+ /** Whether the object is restricted from the current viewer */
+ isRestricted?: Maybe;
+ /** Karma value for the comment. This field is equivalent to WP_Comment->comment_karma and the value matching the "comment_karma" column in SQL. */
+ karma?: Maybe;
+ /** Connection between the Comment type and the Comment type */
+ parent?: Maybe;
+ /** The database id of the parent comment node or null if it is the root comment */
+ parentDatabaseId?: Maybe;
+ /** The globally unique identifier of the parent comment node. */
+ parentId?: Maybe;
+ /** Connection between the Comment type and the Comment type */
+ replies?: Maybe;
+ /** The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL. */
+ status?: Maybe;
+ /** Type of comment. This field is equivalent to WP_Comment->comment_type and the value matching the "comment_type" column in SQL. */
+ type?: Maybe;
+};
+
+
+/** A Comment object */
+export type CommentContentArgs = {
+ format?: InputMaybe;
+};
+
+
+/** A Comment object */
+export type CommentParentArgs = {
+ where?: InputMaybe;
+};
+
+
+/** A Comment object */
+export type CommentRepliesArgs = {
+ after?: InputMaybe;
+ before?: InputMaybe;
+ first?: InputMaybe;
+ last?: InputMaybe;
+ where?: InputMaybe;
+};
+
+/** A Comment Author object */
+export type CommentAuthor = Commenter & DatabaseIdentifier & Node & {
+ __typename?: 'CommentAuthor';
+ /** Avatar object for user. The avatar object can be retrieved in different sizes by specifying the size argument. */
+ avatar?: Maybe;
+ /** The unique identifier stored in the database */
+ databaseId: Scalars['Int']['output'];
+ /** The email for the comment author */
+ email?: Maybe;
+ /** The globally unique identifier for the comment author object */
+ id: Scalars['ID']['output'];
+ /** Whether the object is restricted from the current viewer */
+ isRestricted?: Maybe;
+ /** The name for the comment author. */
+ name?: Maybe;
+ /** The url the comment author. */
+ url?: Maybe;
+};
+
+
+/** A Comment Author object */
+export type CommentAuthorAvatarArgs = {
+ forceDefault?: InputMaybe;
+ rating?: InputMaybe;
+ size?: InputMaybe;
+};
+
+/** Connection to Comment Nodes */
+export type CommentConnection = {
+ /** A list of edges (relational context) between RootQuery and connected Comment Nodes */
+ edges: Array;
+ /** A list of connected Comment Nodes */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CommentConnectionPageInfo;
+};
+
+/** Edge between a Node and a connected Comment */
+export type CommentConnectionEdge = {
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The connected Comment Node */
+ node: Comment;
+};
+
+/** Page Info on the connected CommentConnectionEdge */
+export type CommentConnectionPageInfo = {
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** The Type of Identifier used to fetch a single comment node. Default is "ID". To be used along with the "id" field. */
+export enum CommentNodeIdTypeEnum {
+ /** Identify a resource by the Database ID. */
+ DatabaseId = 'DATABASE_ID',
+ /** Identify a resource by the (hashed) Global ID. */
+ Id = 'ID'
+}
+
+/** The status of the comment object. */
+export enum CommentStatusEnum {
+ /** Comments with the 已核准 status */
+ Approve = 'APPROVE',
+ /** Comments with the 尚未核准 status */
+ Hold = 'HOLD',
+ /** Comments with the 垃圾留言 status */
+ Spam = 'SPAM',
+ /** Comments with the 已移至回收桶 status */
+ Trash = 'TRASH'
+}
+
+/** Connection between the Comment type and the Comment type */
+export type CommentToCommentConnection = CommentConnection & Connection & {
+ __typename?: 'CommentToCommentConnection';
+ /** Edges for the CommentToCommentConnection connection */
+ edges: Array;
+ /** The nodes of the connection, without the edges */
+ nodes: Array;
+ /** Information about pagination in a connection. */
+ pageInfo: CommentToCommentConnectionPageInfo;
+};
+
+/** An edge in a connection */
+export type CommentToCommentConnectionEdge = CommentConnectionEdge & Edge & {
+ __typename?: 'CommentToCommentConnectionEdge';
+ /** A cursor for use in pagination */
+ cursor?: Maybe;
+ /** The item at the end of the edge */
+ node: Comment;
+};
+
+/** Page Info on the "CommentToCommentConnection" */
+export type CommentToCommentConnectionPageInfo = CommentConnectionPageInfo & PageInfo & WpPageInfo & {
+ __typename?: 'CommentToCommentConnectionPageInfo';
+ /** When paginating forwards, the cursor to continue. */
+ endCursor?: Maybe;
+ /** When paginating forwards, are there more items? */
+ hasNextPage: Scalars['Boolean']['output'];
+ /** When paginating backwards, are there more items? */
+ hasPreviousPage: Scalars['Boolean']['output'];
+ /** Raw schema for page */
+ seo?: Maybe;
+ /** When paginating backwards, the cursor to continue. */
+ startCursor?: Maybe;
+};
+
+/** Arguments for filtering the CommentToCommentConnection connection */
+export type CommentToCommentConnectionWhereArgs = {
+ /** Comment author email address. */
+ authorEmail?: InputMaybe;
+ /** Array of author IDs to include comments for. */
+ authorIn?: InputMaybe>>;
+ /** Array of author IDs to exclude comments for. */
+ authorNotIn?: InputMaybe>>;
+ /** Comment author URL. */
+ authorUrl?: InputMaybe;
+ /** Array of comment IDs to include. */
+ commentIn?: InputMaybe>>;
+ /** Array of IDs of users whose unapproved comments will be returned by the query regardless of status. */
+ commentNotIn?: InputMaybe>>;
+ /** Include comments of a given type. */
+ commentType?: InputMaybe;
+ /** Include comments from a given array of comment types. */
+ commentTypeIn?: InputMaybe>>;
+ /** Exclude comments from a given array of comment types. */
+ commentTypeNotIn?: InputMaybe;
+ /** Content object author ID to limit results by. */
+ contentAuthor?: InputMaybe>>;
+ /** Array of author IDs to retrieve comments for. */
+ contentAuthorIn?: InputMaybe>>;
+ /** Array of author IDs *not* to retrieve comments for. */
+ contentAuthorNotIn?: InputMaybe>>;
+ /** Limit results to those affiliated with a given content object ID. */
+ contentId?: InputMaybe;
+ /** Array of content object IDs to include affiliated comments for. */
+ contentIdIn?: InputMaybe>>;
+ /** Array of content object IDs to exclude affiliated comments for. */
+ contentIdNotIn?: InputMaybe>>;
+ /** Content object name (i.e. slug ) to retrieve affiliated comments for. */
+ contentName?: InputMaybe;
+ /** Content Object parent ID to retrieve affiliated comments for. */
+ contentParent?: InputMaybe;
+ /** Array of content object statuses to retrieve affiliated comments for. Pass 'any' to match any value. */
+ contentStatus?: InputMaybe>>;
+ /** Content object type or array of types to retrieve affiliated comments for. Pass 'any' to match any value. */
+ contentType?: InputMaybe>>;
+ /** Array of IDs or email addresses of users whose unapproved comments will be returned by the query regardless of $status. Default empty */
+ includeUnapproved?: InputMaybe>>;
+ /** Karma score to retrieve matching comments for. */
+ karma?: InputMaybe;
+ /** The cardinality of the order of the connection */
+ order?: InputMaybe;
+ /** Field to order the comments by. */
+ orderby?: InputMaybe;
+ /** Parent ID of comment to retrieve children of. */
+ parent?: InputMaybe;
+ /** Array of parent IDs of comments to retrieve children for. */
+ parentIn?: InputMaybe>>;
+ /** Array of parent IDs of comments *not* to retrieve children for. */
+ parentNotIn?: InputMaybe>>;
+ /** Search term(s) to retrieve matching comments for. */
+ search?: InputMaybe;
+ /** Comment status to limit results by. */
+ status?: InputMaybe;
+ /** Include comments for a specific user ID. */
+ userId?: InputMaybe;
+};
+
+/** Connection between the Comment type and the Commenter type */
+export type CommentToCommenterConnectionEdge = CommenterConnectionEdge & Edge & OneToOneConnection & {
+ __typename?: 'CommentToCommenterConnectionEdge';
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The node of the connection, without the edges */
+ node: Commenter;
+};
+
+/** Connection between the Comment type and the ContentNode type */
+export type CommentToContentNodeConnectionEdge = ContentNodeConnectionEdge & Edge & OneToOneConnection & {
+ __typename?: 'CommentToContentNodeConnectionEdge';
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The node of the connection, without the edges */
+ node: ContentNode;
+};
+
+/** Connection between the Comment type and the Comment type */
+export type CommentToParentCommentConnectionEdge = CommentConnectionEdge & Edge & OneToOneConnection & {
+ __typename?: 'CommentToParentCommentConnectionEdge';
+ /** Opaque reference to the nodes position in the connection. Value can be used with pagination args. */
+ cursor?: Maybe;
+ /** The node of the connection, without the edges */
+ node: Comment;
+};
+
+/** Arguments for filtering the CommentToParentCommentConnection connection */
+export type CommentToParentCommentConnectionWhereArgs = {
+ /** Comment author email address. */
+ authorEmail?: InputMaybe;
+ /** Array of author IDs to include comments for. */
+ authorIn?: InputMaybe>>;
+ /** Array of author IDs to exclude comments for. */
+ authorNotIn?: InputMaybe>>;
+ /** Comment author URL. */
+ authorUrl?: InputMaybe