mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Type fixes
This commit is contained in:
@@ -43,11 +43,13 @@ export const getAllProductsQuery = /* GraphQL */ `
|
||||
${productConnectionFragment}
|
||||
`
|
||||
|
||||
export type Product = NonNullable<
|
||||
export type ProductEdge = NonNullable<
|
||||
NonNullable<GetAllProductsQuery['site']['products']['edges']>[0]
|
||||
>
|
||||
|
||||
export type Products = Product[]
|
||||
export type Product = ProductEdge
|
||||
|
||||
export type Products = ProductEdge[]
|
||||
|
||||
export type GetAllProductsResult<
|
||||
T extends Record<keyof GetAllProductsResult, any[]> = { products: Products }
|
||||
|
@@ -6,7 +6,7 @@ export default async function fetchGraphqlApi<Q, V = any>(
|
||||
query: string,
|
||||
{ variables, preview }: CommerceAPIFetchOptions<V> = {}
|
||||
): Promise<Q> {
|
||||
log.warn(query)
|
||||
// log.warn(query)
|
||||
const config = getConfig()
|
||||
const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
|
||||
method: 'POST',
|
||||
|
Reference in New Issue
Block a user