merge main (#1)

* Update README.md to include information on how to add a custom provider (#250)

* Update README.md

* Updated commerce readme

Co-authored-by: Luis Alvarez D <luis@vercel.com>

* Remove unused provider config (#459)

* Updated core types for commerce provider

* Updated bigcommerce provider

* Added util method for provider creation

* Removed unrequired code from saleor

* Updated shopify provider

* Updated providers and local setup

* Updated saleor setup

* Updated swell

* Updated vendure

* Updated swell-js usage

* Removed unrequired import from saleor

Co-authored-by: Isiko Saidiali <54436062+SaidiAli@users.noreply.github.com>
Co-authored-by: Luis Alvarez D <luis@vercel.com>
This commit is contained in:
Kasper Fabricius Kristensen
2021-09-03 16:36:22 +02:00
committed by GitHub
parent 0e7e7b7d5f
commit abaf7220dc
21 changed files with 99 additions and 265 deletions

View File

@@ -1,10 +1,6 @@
import type { OperationContext } from '@commerce/api/operations'
import {
GetAllProductPathsQuery,
GetAllProductPathsQueryVariables,
ProductCountableEdge,
} from '../../schema'
import type { ShopifyConfig, Provider, SaleorConfig } from '..'
import { ProductCountableEdge } from '../../schema'
import type { Provider, SaleorConfig } from '..'
import { getAllProductsPathsQuery } from '../../utils/queries'
import fetchAllProducts from '../utils/fetch-all-products'
@@ -13,10 +9,7 @@ export type GetAllProductPathsResult = {
products: Array<{ path: string }>
}
export default function getAllProductPathsOperation({
commerce,
}: OperationContext<Provider>) {
export default function getAllProductPathsOperation({ commerce }: OperationContext<Provider>) {
async function getAllProductPaths({
query,
config,
@@ -24,7 +17,7 @@ export default function getAllProductPathsOperation({
}: {
query?: string
config?: SaleorConfig
variables?: any
variables?: any
} = {}): Promise<GetAllProductPathsResult> {
config = commerce.getConfig(config)
@@ -39,7 +32,6 @@ export default function getAllProductPathsOperation({
path: `/${slug}`,
})),
}
}
return getAllProductPaths