Skip to content

Commit a642c4a

Browse files
add orders schemas and graphql
1 parent ae1492f commit a642c4a

File tree

10 files changed

+5126
-20
lines changed

10 files changed

+5126
-20
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ dist
4242
/blob-report/
4343
/playwright/.cache/
4444

45-
schema.graphql
46-
storefront.graphql
45+
*.graphql
4746

4847
# macOS
4948
.DS_Store

packages/react/src/components/storefront/product-details.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function ProductDetails({
192192
}, [selectedAttributes]);
193193

194194
// Query for filtered SKUs when attributes are selected
195-
const { data: skuData } = useQuery({
195+
const { data: skuData, isLoading: isFilteredSkuLoading } = useQuery({
196196
queryKey: [
197197
'sku-group-filtered',
198198
storeId,
@@ -542,12 +542,14 @@ export function ProductDetails({
542542
Loading variant details...
543543
</div>
544544
)}
545-
{!isSkuLoading && matchedSkus.length === 0 && (
546-
<div className='text-destructive'>
547-
This combination is not available. Please select different
548-
options.
549-
</div>
550-
)}
545+
{!isSkuLoading &&
546+
!isFilteredSkuLoading &&
547+
matchedSkus.length === 0 && (
548+
<div className='text-destructive'>
549+
This combination is not available. Please select different
550+
options.
551+
</div>
552+
)}
551553
{!isSkuLoading && matchedSkus.length > 1 && (
552554
<div className='text-muted-foreground'>
553555
{matchedSkus.length} variants match your selection. Select

packages/react/src/lib/godaddy/storefront-env.ts renamed to packages/react/src/lib/godaddy/catalog-storefront-env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* ```
2424
*/
2525
const introspection = {
26-
name: 'storefront-api',
26+
name: 'catalog-api',
2727
__schema: {
2828
queryType: {
2929
name: 'Query',

packages/react/src/lib/godaddy/storefront-queries.ts renamed to packages/react/src/lib/godaddy/catalog-storefront-queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { graphql } from '@/lib/gql/gql-storefront.tada';
1+
import { graphql } from '@/lib/gql/gql-catalog-storefront.tada.ts';
22

33
export const SkuGroupsQuery = graphql(`
44
query SkuGroups($first: Int, $after: String, $id: SKUGroupIdsFilter, $attributeValues: [String!] = []) {

packages/react/src/lib/godaddy/godaddy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { ResultOf } from 'gql.tada';
22
import { convertCSSVariablesToCamelCase } from '@/components/checkout/utils/case-conversion';
33
import type { GoDaddyAppearance } from '@/godaddy-provider';
4-
import { SkuGroupsQuery, SkuQuery } from '@/lib/godaddy/storefront-queries.ts';
4+
import {
5+
SkuGroupsQuery,
6+
SkuQuery,
7+
} from '@/lib/godaddy/catalog-storefront-queries.ts';
58
import { graphqlRequestWithErrors } from '@/lib/graphql-with-errors';
69
import type {
710
ApplyCheckoutSessionDeliveryMethodInput,

0 commit comments

Comments
 (0)