From 774f6fd782d3283d8528d204ab8eec5977634e3a Mon Sep 17 00:00:00 2001 From: Josh Worden Date: Thu, 27 May 2021 10:20:16 -0500 Subject: [PATCH 1/2] Add GraphQL docs to AllPublishedContent input --- .../definitions/platform/content/index.js | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/services/graphql-server/src/graphql/definitions/platform/content/index.js b/services/graphql-server/src/graphql/definitions/platform/content/index.js index 59cc8d270..d535969be 100644 --- a/services/graphql-server/src/graphql/definitions/platform/content/index.js +++ b/services/graphql-server/src/graphql/definitions/platform/content/index.js @@ -32,6 +32,9 @@ extend type Query { queryBuilder: "allContent", withSite: false, # allow content to always load, regardless of site context. ) + """ + Returns all published content items matching the supplied criteria. + """ allPublishedContent(input: AllPublishedContentQueryInput = {}): ContentConnection! publishedContentCounts(input: PublishedContentCountsQueryInput = {}): [PublishedContentCount!]! contentSitemapUrls(input: ContentSitemapUrlsQueryInput = {}): [ContentSitemapUrl!]! @@ -284,23 +287,71 @@ input ContentSitemapNewsUrlsQueryInput { } input AllPublishedContentQueryInput { + """ + Limits results to content with a primary site matching the current site context + """ withSite: Boolean = true + """ + A websiteSite identifier. If present, overrides the current site context. + """ siteId: ObjectID + """ + Limit results to items published after this date. + """ after: Date + """ + Limit results to items published before this date. + """ since: Date + """ + Limit results to items with this primary section id. + """ sectionId: Int - # @deprecated. Use \`AllPublishedContentQueryInput.includeContentTypes\` instead. + """ + Deprecated. Use includeContentTypes instead. + """ contentTypes: [ContentType!] = [] + """ + Limit results to items matching at least one of these types. + """ includeContentTypes: [ContentType!] = [] + """ + Limit results to items matching none of these types. + """ excludeContentTypes: [ContentType!] = [] + """ + Limit results to items matching none of these ids. + """ excludeContentIds: [Int!] = [] + """ + Limit results to items matching at least one of these ids. + """ includeTaxonomyIds: [Int!] = [] + """ + Limit results to items matching at least one of these labels. + """ includeLabels: [String!] = [] + """ + Limit results to items that have a primary image. + """ requiresImage: Boolean = false + """ + Include child sections when limiting by primary section id. + """ sectionBubbling: Boolean = true + """ + """ sort: ContentSortInput = { field: published, order: desc } + """ + """ pagination: PaginationInput = {} + """ + For types with a startDate field: Limit results to items with a startDate matching the criteria. + """ beginning: ContentBeginningInput = {} + """ + For types with a endDate field: Limit results to items with a endDate matching the criteria. + """ ending: ContentEndingInput = {} } From 9912b71830c04c511faa3416acc12535c3d5a3fd Mon Sep 17 00:00:00 2001 From: Josh Worden Date: Thu, 27 May 2021 12:05:54 -0500 Subject: [PATCH 2/2] Change comment syntax --- .../definitions/platform/content/index.js | 70 +++++-------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/services/graphql-server/src/graphql/definitions/platform/content/index.js b/services/graphql-server/src/graphql/definitions/platform/content/index.js index d535969be..7b8c8ca7a 100644 --- a/services/graphql-server/src/graphql/definitions/platform/content/index.js +++ b/services/graphql-server/src/graphql/definitions/platform/content/index.js @@ -32,9 +32,7 @@ extend type Query { queryBuilder: "allContent", withSite: false, # allow content to always load, regardless of site context. ) - """ - Returns all published content items matching the supplied criteria. - """ + "Returns all published content items matching the supplied criteria." allPublishedContent(input: AllPublishedContentQueryInput = {}): ContentConnection! publishedContentCounts(input: PublishedContentCountsQueryInput = {}): [PublishedContentCount!]! contentSitemapUrls(input: ContentSitemapUrlsQueryInput = {}): [ContentSitemapUrl!]! @@ -287,71 +285,39 @@ input ContentSitemapNewsUrlsQueryInput { } input AllPublishedContentQueryInput { - """ - Limits results to content with a primary site matching the current site context - """ + "Limits results to content with a primary site matching the current site context " withSite: Boolean = true - """ - A websiteSite identifier. If present, overrides the current site context. - """ + "A websiteSite identifier. If present, overrides the current site context." siteId: ObjectID - """ - Limit results to items published after this date. - """ + "Limit results to items published after this date." after: Date - """ - Limit results to items published before this date. - """ + "Limit results to items published before this date." since: Date - """ - Limit results to items with this primary section id. - """ + "Limit results to items with this primary section id." sectionId: Int - """ - Deprecated. Use includeContentTypes instead. - """ + "Deprecated. Use includeContentTypes instead." contentTypes: [ContentType!] = [] - """ - Limit results to items matching at least one of these types. - """ + "Limit results to items matching at least one of these types." includeContentTypes: [ContentType!] = [] - """ - Limit results to items matching none of these types. - """ + "Limit results to items matching none of these types." excludeContentTypes: [ContentType!] = [] - """ - Limit results to items matching none of these ids. - """ + "Limit results to items matching none of these ids." excludeContentIds: [Int!] = [] - """ - Limit results to items matching at least one of these ids. - """ + "Limit results to items matching at least one of these ids." includeTaxonomyIds: [Int!] = [] - """ - Limit results to items matching at least one of these labels. - """ + "Limit results to items matching at least one of these labels." includeLabels: [String!] = [] - """ - Limit results to items that have a primary image. - """ + "Limit results to items that have a primary image." requiresImage: Boolean = false - """ - Include child sections when limiting by primary section id. - """ + "Include child sections when limiting by primary section id." sectionBubbling: Boolean = true - """ - """ + "Adjusts the order items are returned in." sort: ContentSortInput = { field: published, order: desc } - """ - """ + "Adjust which subset of results should be returned." pagination: PaginationInput = {} - """ - For types with a startDate field: Limit results to items with a startDate matching the criteria. - """ + "For types with a startDate field: Limit results to items with a startDate matching the criteria." beginning: ContentBeginningInput = {} - """ - For types with a endDate field: Limit results to items with a endDate matching the criteria. - """ + "For types with a endDate field: Limit results to items with a endDate matching the criteria." ending: ContentEndingInput = {} }