forked from crowetic/commerce
Renamed lib
This commit is contained in:
parent
c9f540cbd0
commit
604a7b86c9
@ -1,6 +1,6 @@
|
|||||||
import { CommerceAPIConfig } from 'lib/commerce/api'
|
import { CommerceAPIConfig } from 'lib/commerce/api'
|
||||||
import { GetAllProductsQueryVariables } from '../schema'
|
import { GetAllProductsQueryVariables } from '../schema'
|
||||||
import fetchAPI from './utils/fetch-api'
|
import fetchGraphqlApi from './utils/fetch-graphql-api'
|
||||||
import fetchStoreApi from './utils/fetch-store-api'
|
import fetchStoreApi from './utils/fetch-store-api'
|
||||||
|
|
||||||
export interface Images {
|
export interface Images {
|
||||||
@ -107,7 +107,7 @@ const config = new Config({
|
|||||||
commerceUrl: API_URL,
|
commerceUrl: API_URL,
|
||||||
apiToken: API_TOKEN,
|
apiToken: API_TOKEN,
|
||||||
cartCookie: process.env.BIGCOMMERCE_CART_COOKIE ?? 'bc_cartId',
|
cartCookie: process.env.BIGCOMMERCE_CART_COOKIE ?? 'bc_cartId',
|
||||||
fetch: fetchAPI,
|
fetch: fetchGraphqlApi,
|
||||||
// REST API only
|
// REST API only
|
||||||
storeApiUrl: STORE_API_URL,
|
storeApiUrl: STORE_API_URL,
|
||||||
storeApiToken: STORE_API_TOKEN,
|
storeApiToken: STORE_API_TOKEN,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { CommerceAPIFetchOptions } from 'lib/commerce/api'
|
import { CommerceAPIFetchOptions } from 'lib/commerce/api'
|
||||||
import { getConfig } from '..'
|
import { getConfig } from '..'
|
||||||
|
|
||||||
export default async function fetchAPI<Q, V = any>(
|
export default async function fetchGraphqlApi<Q, V = any>(
|
||||||
query: string,
|
query: string,
|
||||||
{ variables, preview }: CommerceAPIFetchOptions<V> = {}
|
{ variables, preview }: CommerceAPIFetchOptions<V> = {}
|
||||||
): Promise<Q> {
|
): Promise<Q> {
|
Loading…
x
Reference in New Issue
Block a user