Apollo React useMutation hook

    0

    2

    Jose Romero

    reactapollohookβ€’β€’β€’
    React JavaScript Recipes

    Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, React Query exports a useMutation hook.

    Library: react

    Shortcut: apollo.hook.mutation.use

    import { useMutation } from '@apollo/client';
    
    const [createAPIToken] = useMutation(GRAPHQL_MUTATION, { 
      variables: {
        //
      },
      onCompleted: (data) => {
      	//
      });
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.