sdy

add useMutation

1 import React, { useEffect, useState } from "react"; 1 import React, { useEffect, useState } 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 { useQuery } from "@apollo/react-hooks"; 4 +import { useQuery, useMutation } from "@apollo/react-hooks";
5 import { 5 import {
6 GET_CATEGORIRES, 6 GET_CATEGORIRES,
7 ADD_CATEGORY, 7 ADD_CATEGORY,
...@@ -16,7 +16,6 @@ export default withRouter(({ location }) => { ...@@ -16,7 +16,6 @@ export default withRouter(({ location }) => {
16 error: categoryQueryError, 16 error: categoryQueryError,
17 loading: categoryQueryLoading, 17 loading: categoryQueryLoading,
18 } = useQuery(GET_CATEGORIRES); 18 } = useQuery(GET_CATEGORIRES);
19 - const [addCategory] = useMutation(ADD_CATEGORY);
20 19
21 let categories; 20 let categories;
22 if (categoryList !== undefined) { 21 if (categoryList !== undefined) {
......