Skip to content

Commit

Permalink
Fix the starter template blog route to include a required `startCurso…
Browse files Browse the repository at this point in the history
…r` in the GraphQL query.

Resolves #1337
  • Loading branch information
blittle committed Oct 20, 2023
1 parent 45b9831 commit da2f641
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
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
1 change: 1 addition & 0 deletions templates/skeleton/app/routes/account.orders._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const CUSTOMER_FRAGMENT = `#graphql
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

0 comments on commit da2f641

Please # to comment.