Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix the starter template blog route to include a required startCursor in the GraphQL query. #1441

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/itchy-panthers-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'demo-store': patch
'@shopify/create-hydrogen': patch
---

Fix the starter template blog route to include a required `startCursor` in the GraphQL query.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ const COLLECTION_QUERY = `#graphql
pageInfo {
hasPreviousPage
hasNextPage
hasNextPage
endCursor
startCursor
}
Expand Down
2 changes: 1 addition & 1 deletion templates/demo-store/storefrontapi.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ interface GeneratedQueryTypes {
return: ApiAllProductsQuery;
variables: ApiAllProductsQueryVariables;
};
'#graphql\n query CollectionDetails(\n $handle: String!\n $country: CountryCode\n $language: LanguageCode\n $filters: [ProductFilter!]\n $sortKey: ProductCollectionSortKeys!\n $reverse: Boolean\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(country: $country, language: $language) {\n collection(handle: $handle) {\n id\n handle\n title\n description\n seo {\n description\n title\n }\n image {\n id\n url\n width\n height\n altText\n }\n products(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor,\n filters: $filters,\n sortKey: $sortKey,\n reverse: $reverse\n ) {\n filters {\n id\n label\n type\n values {\n id\n label\n count\n input\n }\n }\n nodes {\n ...ProductCard\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n hasNextPage\n endCursor\n startCursor\n }\n }\n }\n collections(first: 100) {\n edges {\n node {\n title\n handle\n }\n }\n }\n }\n #graphql\n fragment ProductCard on Product {\n id\n title\n publishedAt\n handle\n vendor\n variants(first: 1) {\n nodes {\n id\n availableForSale\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n product {\n handle\n title\n }\n }\n }\n }\n\n': {
'#graphql\n query CollectionDetails(\n $handle: String!\n $country: CountryCode\n $language: LanguageCode\n $filters: [ProductFilter!]\n $sortKey: ProductCollectionSortKeys!\n $reverse: Boolean\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(country: $country, language: $language) {\n collection(handle: $handle) {\n id\n handle\n title\n description\n seo {\n description\n title\n }\n image {\n id\n url\n width\n height\n altText\n }\n products(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor,\n filters: $filters,\n sortKey: $sortKey,\n reverse: $reverse\n ) {\n filters {\n id\n label\n type\n values {\n id\n label\n count\n input\n }\n }\n nodes {\n ...ProductCard\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n endCursor\n startCursor\n }\n }\n }\n collections(first: 100) {\n edges {\n node {\n title\n handle\n }\n }\n }\n }\n #graphql\n fragment ProductCard on Product {\n id\n title\n publishedAt\n handle\n vendor\n variants(first: 1) {\n nodes {\n id\n availableForSale\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n product {\n handle\n title\n }\n }\n }\n }\n\n': {
return: CollectionDetailsQuery;
variables: CollectionDetailsQueryVariables;
};
Expand Down
2 changes: 1 addition & 1 deletion templates/skeleton/app/routes/account.orders._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export const CUSTOMER_FRAGMENT = `#graphql
pageInfo {
hasPreviousPage
hasNextPage
hasNextPage
endCursor
startCursor
}
}
}
Expand Down
1 change: 1 addition & 0 deletions templates/skeleton/app/routes/blogs.$blogHandle._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const BLOGS_QUERY = `#graphql
hasNextPage
hasNextPage
endCursor
startCursor
}

}
Expand Down
8 changes: 4 additions & 4 deletions templates/skeleton/storefrontapi.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export type CustomerOrdersFragment = Pick<
>;
pageInfo: Pick<
StorefrontAPI.PageInfo,
'hasPreviousPage' | 'hasNextPage' | 'endCursor'
'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
>;
};
};
Expand Down Expand Up @@ -689,7 +689,7 @@ export type CustomerOrdersQuery = {
>;
pageInfo: Pick<
StorefrontAPI.PageInfo,
'hasPreviousPage' | 'hasNextPage' | 'endCursor'
'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
>;
};
}
Expand Down Expand Up @@ -1113,7 +1113,7 @@ export type BlogQuery = {
>;
pageInfo: Pick<
StorefrontAPI.PageInfo,
'hasPreviousPage' | 'hasNextPage' | 'endCursor'
'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
>;
};
}
Expand Down Expand Up @@ -1811,7 +1811,7 @@ interface GeneratedQueryTypes {
return: ArticleQuery;
variables: ArticleQueryVariables;
};
'#graphql\n query Blog(\n $language: LanguageCode\n $blogHandle: String!\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n title\n seo {\n title\n description\n }\n articles(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor\n ) {\n nodes {\n ...ArticleItem\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n hasNextPage\n endCursor\n }\n\n }\n }\n }\n fragment ArticleItem on Article {\n author: authorV2 {\n name\n }\n contentHtml\n handle\n id\n image {\n id\n altText\n url\n width\n height\n }\n publishedAt\n title\n blog {\n handle\n }\n }\n': {
'#graphql\n query Blog(\n $language: LanguageCode\n $blogHandle: String!\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n title\n seo {\n title\n description\n }\n articles(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor\n ) {\n nodes {\n ...ArticleItem\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n hasNextPage\n endCursor\n startCursor\n }\n\n }\n }\n }\n fragment ArticleItem on Article {\n author: authorV2 {\n name\n }\n contentHtml\n handle\n id\n image {\n id\n altText\n url\n width\n height\n }\n publishedAt\n title\n blog {\n handle\n }\n }\n': {
return: BlogQuery;
variables: BlogQueryVariables;
};
Expand Down