setup custom fetcher and auth hooks

This commit is contained in:
Greg Hoskin
2021-03-27 15:54:32 -06:00
parent 753234dc51
commit ee1d8ed461
37 changed files with 299 additions and 103 deletions

View File

@@ -1,10 +1,10 @@
import { CollectionEdge } from '../schema'
import { getConfig, ShopifyConfig } from '../api'
import { getConfig, SwellConfig } from '../api'
import getAllCollectionsQuery from '../utils/queries/get-all-collections-query'
const getAllCollections = async (options?: {
variables?: any
config: ShopifyConfig
config: SwellConfig
preview?: boolean
}) => {
let { config, variables = { first: 250 } } = options ?? {}

View File

@@ -1,5 +1,5 @@
import { Product } from '@commerce/types'
import { getConfig, ShopifyConfig } from '../api'
import { getConfig, SwellConfig } from '../api'
import fetchAllProducts from '../api/utils/fetch-all-products'
import { ProductEdge } from '../schema'
import getAllProductsPathsQuery from '../utils/queries/get-all-products-paths-query'
@@ -18,7 +18,7 @@ type ReturnType = {
const getAllProductPaths = async (options?: {
variables?: any
config?: ShopifyConfig
config?: SwellConfig
preview?: boolean
}): Promise<ReturnType> => {
let { config, variables = { first: 250 } } = options ?? {}

View File

@@ -1,5 +1,5 @@
import { GraphQLFetcherResult } from '@commerce/api'
import { getConfig, ShopifyConfig } from '../api'
import { getConfig, SwellConfig } from '../api'
import { ProductEdge } from '../schema'
import { getAllProductsQuery } from '../utils/queries'
import { normalizeProduct } from '../utils/normalize'
@@ -16,7 +16,7 @@ type ReturnType = {
const getAllProducts = async (options: {
variables?: Variables
config?: ShopifyConfig
config?: SwellConfig
preview?: boolean
}): Promise<ReturnType> => {
let { config, variables = { first: 250 } } = options ?? {}

View File

@@ -1,5 +1,5 @@
import { GraphQLFetcherResult } from '@commerce/api'
import { getConfig, ShopifyConfig } from '../api'
import { getConfig, SwellConfig } from '../api'
import { normalizeProduct, getProductQuery } from '../utils'
type Variables = {
@@ -12,7 +12,7 @@ type ReturnType = {
const getProduct = async (options: {
variables: Variables
config: ShopifyConfig
config: SwellConfig
preview?: boolean
}): Promise<ReturnType> => {
let { config, variables } = options ?? {}