Showing
1 changed file
with
11 additions
and
0 deletions
1 | import React from "react"; | 1 | import React from "react"; |
2 | import CategoryPresenter from "./CategoryPresenter"; | 2 | import CategoryPresenter from "./CategoryPresenter"; |
3 | import { withRouter } from "react-router-dom"; | 3 | import { withRouter } from "react-router-dom"; |
4 | +import { useMutation, useQuery } from "@apollo/react-hooks"; | ||
5 | +import { | ||
6 | + GET_CATEGORIRES, | ||
7 | + ADD_CATEGORY, | ||
8 | + EDIT_CATEGORY, | ||
9 | + DELETE_CATEGORY, | ||
10 | +} from "./CategoryQueries"; | ||
4 | 11 | ||
5 | export default withRouter(({ location }) => { | 12 | export default withRouter(({ location }) => { |
13 | + const { data } = useQuery(GET_CATEGORIRES); | ||
14 | + const [addCategory] = useMutation(ADD_CATEGORY); | ||
15 | + const [editCategory] = useMutation(EDIT_CATEGORY); | ||
16 | + const [deleteCategory] = useMutation(DELETE_CATEGORY); | ||
6 | return <CategoryPresenter location={location} />; | 17 | return <CategoryPresenter location={location} />; |
7 | }); | 18 | }); | ... | ... |
-
Please register or login to post a comment