Mutation Reference

Mutations

insert

mutation [<mutation-name>] {
    insert_<object-name> (
        objects: [object!]!
        on_conflict: on_conflict_input
    )
    mutation_response
}

insert_one

mutation [<mutation-name>] {
    insert_<object-name>_one (
        object: object
        on_conflict: on_conflict_input
    )
    object
}

update

mutation [<mutation-name>] {
    update_<object-name> (
        where: bool_exp,
        _set: set_input,
        _inc: inc_input,
    )
    mutation_response
}

update_by_pk

mutation [<mutation-name>] {
    update_<object-name>_by_pk (
        pk_columns: pk_columns_input!,
        _set: set_input
        _inc: inc_input
    )
    object
}

delete

mutation [<mutation-name>] {
    delete_<object-name> (
        where: bool_exp
    )
    mutation_response
}

delete_by_pk

mutation [<mutation-name>] {
    delete_<object-name>_by_pk (
        key_column: value!
    )
    object
}

Common Types

object

type <object-name> {
   field1: value1,
   field2: value2,
}

mutation_response

type <object-name>_mutation_response {
    affected_rows: Int!
    returning: [object!]!
}

Arguments

on_conflict_input

type <object-name>_on_conflict {
    merge: Boolean!
}

pk_columns_input

type <object-name>_pk_columns_input {
    key-column: column-type
}

set_input

type <object-name>_set_input {
    field1: field1-type
    field2: field2-type
}

inc_input

type <object-name>_inc_input {
    num-field1: num-field1-type
    num-field2: num-field2-type
}