GraphQL Mutation Standards

GraphQL Mutation Standards

This article provides an introduction to GraphQL Mutation Standards.

Overview

When working with GraphQL in the Fuuz environment there are four types of mutations to consider:

  1. Create

  2. Update

  3. Upsert

  4. Delete

Usage Standards

  • Only use a create statements when you are confident data does not exist

  • Examples include: Historical records, Time-sensitive data, Tables that do not allow updates, or a process that only adds new records

  • Only use an update statement when you are confident data does exist

    • Example: Data-driven events that update data behind the scenes

    • Example: Process that sends records elsewhere and updates their status

  • Only use an upsert statement when you are not confident about existing data

    • Example: Integration processes that pull in data from other systems and store it by their IDs

  • Only use delete statements when absolutely necessary, consider using TTL indexing instead on tables as an alternative

Design Pattern

All mutations used in production flows must:

  • Start with the word mutation

  • Be named the same as the mutation action itself

  • Contain the parameter which is $payload: [SomeObejct!]!

  • Avoid containing disable reference checks without prior approval

    • Related Articles

    • Fuuz Schema Design Standards

      This article provides an introduction to Fuuz schema design standards. Custom Schema Example Schemas Documentation Label Field Data Change Capture Retention Days TTL Mutations Column Naming Grouping And Ordering Depending on the version, some of the ...
    • GraphQL API

      GraphQL | A query language for your API graphql.org GraphQL is the preferred API query langauge for modern systems, like Fuuz. You can leverage GraphQL within the Fuuz Platform by navigating to the “API Explorer” Overview of GraphQL: Background, ...
    • GraphQL Advantages

      GraphQL offers several advantages over traditional REST API calls, making it a superior choice in certain scenarios. Here are some ways in which GraphQL excels compared to REST: Efficient Data Retrieval: With REST APIs, clients often receive more ...
    • GraphQL Field Predicates

      GraphQL Field Predicates
    • MongoDB with GraphQL Benefits

      Using MongoDB with GraphQL offers several benefits that combine the flexibility of a NoSQL database with the efficiency and tailored data retrieval of GraphQL. Here are some advantages of using MongoDB with GraphQL: Flexible Data Modeling: MongoDB's ...