587c0cdeba
Also: * introduce __typename to all response types
38 lines
653 B
TypeScript
38 lines
653 B
TypeScript
import {gql} from "@apollo/client";
|
|
|
|
export const BasicCategoryFragment = gql`
|
|
fragment BasicCategoryFragment on Category {
|
|
id
|
|
rowId
|
|
title
|
|
description
|
|
}
|
|
`
|
|
|
|
export interface BasicCategoryResponse {
|
|
id: string,
|
|
rowId: number,
|
|
title: string,
|
|
description: string | null,
|
|
__typename: "Category",
|
|
}
|
|
|
|
export const GET_ALL_CATEGORIES = gql`
|
|
query AllCategories {
|
|
allCategories {
|
|
nodes {
|
|
...BasicCategoryFragment
|
|
}
|
|
}
|
|
}
|
|
${BasicCategoryFragment}
|
|
`
|
|
|
|
export interface GetAllCategoriesResponse {
|
|
allCategories: {
|
|
nodes: Array<BasicCategoryResponse>,
|
|
__typename: "CategoriesConnection",
|
|
}
|
|
}
|
|
|