split category fetching from menu items
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Generated by scripts/endpoint-generate.mjs — do not edit by hand */
|
||||
import type { ExecutionResult } from "graphql";
|
||||
|
||||
import { execute } from "../graphql/execute";
|
||||
import type { CategoriesListQuery, CategoriesListQueryVariables } from "../graphql/graphql";
|
||||
import { categoriesListDocument } from "./categories.gql";
|
||||
|
||||
export const categoriesListQuery = {
|
||||
async execute(variables?: CategoriesListQueryVariables): Promise<ExecutionResult<CategoriesListQuery>> {
|
||||
return execute<CategoriesListQuery, CategoriesListQueryVariables>(categoriesListDocument, variables);
|
||||
},
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const categoriesListDocument = gql`
|
||||
query CategoriesList($group: String) {
|
||||
categories(filters: { group: { eq: $group } }) {
|
||||
documentId
|
||||
slug
|
||||
title
|
||||
sortOrder
|
||||
group
|
||||
badge
|
||||
}
|
||||
}
|
||||
`
|
||||
13
src/graphql-documents/category.gql.generated.ts
Normal file
13
src/graphql-documents/category.gql.generated.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/* eslint-disable */
|
||||
/* Generated by scripts/endpoint-generate.mjs — do not edit by hand */
|
||||
import type { ExecutionResult } from "graphql";
|
||||
|
||||
import { execute } from "../graphql/execute";
|
||||
import type { CategoryQuery, CategoryQueryVariables } from "../graphql/graphql";
|
||||
import { categoryDocument } from "./category.gql";
|
||||
|
||||
export const categoryQuery = {
|
||||
async execute(variables?: CategoryQueryVariables): Promise<ExecutionResult<CategoryQuery>> {
|
||||
return execute<CategoryQuery, CategoryQueryVariables>(categoryDocument, variables);
|
||||
},
|
||||
};
|
||||
22
src/graphql-documents/category.gql.ts
Normal file
22
src/graphql-documents/category.gql.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const categoryDocument = gql`
|
||||
query Category($slug: String!) {
|
||||
categories(filters: { slug: { eq: $slug } }, pagination: { pageSize: 1 }) {
|
||||
slug
|
||||
title
|
||||
description
|
||||
group
|
||||
badge
|
||||
vendors(pagination: { pageSize: 200 }) {
|
||||
slug
|
||||
title
|
||||
description
|
||||
products(pagination: { pageSize: 200 }) {
|
||||
id
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
Reference in New Issue
Block a user