Update Vendure provider to latest API changes (#352)

Relates to #349
This commit is contained in:
Michael Bromley
2021-06-02 16:46:38 +02:00
committed by GitHub
parent a98c95d447
commit 0e804d09f9
81 changed files with 1265 additions and 698 deletions

View File

@@ -1,6 +1,6 @@
import { FetcherError } from '@commerce/utils/errors'
import type { GraphQLFetcher } from '@commerce/api'
import { getConfig } from '..'
import { getCommerceApi } from '../'
import fetch from './fetch'
const fetchGraphqlApi: GraphQLFetcher = async (
@@ -8,12 +8,11 @@ const fetchGraphqlApi: GraphQLFetcher = async (
{ variables, preview } = {},
fetchOptions
) => {
const config = getConfig()
const config = getCommerceApi().getConfig()
const res = await fetch(config.commerceUrl, {
...fetchOptions,
method: 'POST',
headers: {
Authorization: `Bearer ${config.apiToken}`,
...fetchOptions?.headers,
'Content-Type': 'application/json',
},