Mutation Typed Starter

    0

    4

    Strong Snippets

    A starter snippet to quickly create typed mutations.

    Depending how you structure your queries/mutations/types, you might want to move the variable and data types to a separate file.

    If you like the keep logic close together, consider creating a new file for each mutation.

    Note: The type in your mutations might not be the same as in your typed variables file.

    Library: graphql

    Shortcut: start.typed.mutation

    import { gql } from "@apollo/client";
    
    export type PascalCaseQueryNameData = {
      camelCaseQueryName: string;
    };
    
    export type PascalCaseQueryNameVariables = {
      var1name: var1type;
    };
    
    export const UPPERCASE_UNDERSCORE_QUERYNAME = gql`
      mutation camelCaseQueryName($var1name: yourGraphqlType) {
        camelCaseQueryName(var1name: $var1name)
      }
    `;
    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.