import { useQuery } from '@apollo/client';
      
      const { data, error, loading, refetch } = useQuery(GRAPHQL_QUERY, { 
        variables: { }
      });
      Javascript language logo
      your recipe card header background

      React Apollo query hook refetch

      0

      2

      avatar
      Jose Romero
      apollo
      react
      useQuery
      ...
      React JavaScript Recipes

      Example usage of the useQuery hook from Apollo in React. Here data is an object containing the results of the query, error is an object if there was an error while trying to get the data, or undefined if everything went well. And loading is a boolean indicating whether the server is currently loading the query's data or not. And refetch is a function

      Library: react

      Shortcut: apollo.query.refetch.hook.use

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.