Added basis setup and type generation for the products queries

This commit is contained in:
royderks
2021-04-16 16:28:52 +02:00
committed by Zaiste
parent ffe5a1c20e
commit b5e21a54b3
25 changed files with 32173 additions and 14243 deletions

View File

@@ -11,16 +11,16 @@ export type Category = {
const getCategories = async (config: SaleorConfig): Promise<Category[]> => {
const { data } = await config.fetch(getSiteCollectionsQuery, {
variables: {
first: 250,
first: 100,
},
})
return (
data.collections?.edges?.map(
({ node: { id: entityId, title: name, handle } }: CollectionEdge) => ({
({ node: { id: entityId, name, slug } }: CollectionEdge) => ({
entityId,
name,
path: `/${handle}`,
path: `/${slug}`,
})
) ?? []
)