saleor: simplify the naming for GraphQL statements

This commit is contained in:
Zaiste
2021-05-12 12:07:26 +02:00
parent 42ae126b7b
commit 2fe2c71fc3
35 changed files with 76 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
import { CollectionCountableEdge } from '../schema'
import { getConfig, SaleorConfig } from '../api'
import getAllCollectionsQuery from '../utils/queries/get-all-collections-query'
import { getSiteCollectionsQuery } from '../utils/queries'
const getAllCollections = async (options?: {
variables?: any
@@ -10,7 +10,7 @@ const getAllCollections = async (options?: {
let { config, variables = { first: 100 } } = options ?? {}
config = getConfig(config)
const { data } = await config.fetch(getAllCollectionsQuery, { variables })
const { data } = await config.fetch(getSiteCollectionsQuery, { variables })
const edges = data.collections?.edges ?? []
const categories = edges.map(