mirror of
https://github.com/vercel/commerce.git
synced 2025-07-25 11:11:24 +00:00
Fixes
This commit is contained in:
@@ -3,13 +3,13 @@ import type { GraphQLFetcher } from '@commerce/api'
|
||||
import { provider } from '..'
|
||||
import fetch from './fetch'
|
||||
|
||||
const { config } = provider
|
||||
const fetchGraphqlApi: GraphQLFetcher = async (
|
||||
query: string,
|
||||
{ variables, preview } = {},
|
||||
fetchOptions
|
||||
) => {
|
||||
// log.warn(query)
|
||||
const { config } = provider
|
||||
const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
|
||||
...fetchOptions,
|
||||
method: 'POST',
|
||||
|
@@ -3,12 +3,11 @@ import { provider } from '..'
|
||||
import { BigcommerceApiError, BigcommerceNetworkError } from './errors'
|
||||
import fetch from './fetch'
|
||||
|
||||
const { config } = provider
|
||||
|
||||
export default async function fetchStoreApi<T>(
|
||||
endpoint: string,
|
||||
options?: RequestInit
|
||||
): Promise<T> {
|
||||
const { config } = provider
|
||||
let res: Response
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user