import { useMutation } from '@apollo/client';
      
      const [runMutation, {data, loading, error}] = useMutation<TypeResponse, TypeVariables>(GRAPHQL_MUTATION, {
        refetchQueries: [
          { query: GRAPHQL_QUERY,
            variables: {
          		
          	} },
        ]
      });

      Typescript language logo
      your recipe card header background
      Apollo React useMutation with refetchQueries

      react
      apollo
      hook
      ...
      React TypeScript Recipes

      One of the most common use cases front-end developers face is re-render the UI after executing a mutation and changing something in the backend.

      To solve this problem, a lot of developers like to use the refetchQueries API.

      Shortcut: apollo.hook.mutation.use.refetch.use

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.