4
0
forked from crowetic/commerce

Renamed lib

This commit is contained in:
Luis Alvarez 2020-10-03 16:24:12 -05:00
parent c9f540cbd0
commit 604a7b86c9
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { CommerceAPIConfig } from 'lib/commerce/api'
import { GetAllProductsQueryVariables } from '../schema'
import fetchAPI from './utils/fetch-api'
import fetchGraphqlApi from './utils/fetch-graphql-api'
import fetchStoreApi from './utils/fetch-store-api'
export interface Images {
@ -107,7 +107,7 @@ const config = new Config({
commerceUrl: API_URL,
apiToken: API_TOKEN,
cartCookie: process.env.BIGCOMMERCE_CART_COOKIE ?? 'bc_cartId',
fetch: fetchAPI,
fetch: fetchGraphqlApi,
// REST API only
storeApiUrl: STORE_API_URL,
storeApiToken: STORE_API_TOKEN,

View File

@ -1,7 +1,7 @@
import { CommerceAPIFetchOptions } from 'lib/commerce/api'
import { getConfig } from '..'
export default async function fetchAPI<Q, V = any>(
export default async function fetchGraphqlApi<Q, V = any>(
query: string,
{ variables, preview }: CommerceAPIFetchOptions<V> = {}
): Promise<Q> {