Latest Changes - Logger, Size and Colors
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { CommerceAPIFetchOptions } from 'lib/commerce/api'
|
||||
import { getConfig } from '..'
|
||||
import log from '@lib/logger'
|
||||
|
||||
export default async function fetchGraphqlApi<Q, V = any>(
|
||||
query: string,
|
||||
{ variables, preview }: CommerceAPIFetchOptions<V> = {}
|
||||
): Promise<Q> {
|
||||
log.warn(query)
|
||||
const config = getConfig()
|
||||
const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user