From 494fd057d60cd205573861813c933e171f79342a Mon Sep 17 00:00:00 2001 From: Michael Webb <28074382+mjfwebb@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:30:08 +0200 Subject: [PATCH] Remove section about mixing PUSH and POP This section is not needed as it describes what can be considered normal GraphQL usage. --- modules/ROOT/pages/mutations/update.adoc | 50 ------------------------ 1 file changed, 50 deletions(-) diff --git a/modules/ROOT/pages/mutations/update.adoc b/modules/ROOT/pages/mutations/update.adoc index 83d05f57..bb4ffc1f 100644 --- a/modules/ROOT/pages/mutations/update.adoc +++ b/modules/ROOT/pages/mutations/update.adoc @@ -398,56 +398,6 @@ a| |=== ==== -=== Mixing `_PUSH` and `_POP` - -It is possible to perform both a `_PUSH` and `_POP` operation in one single `update` mutation. - -Consider the following type definitions: - -[source, graphql, indent=0] ----- -type Movie { - title: String - tags: [String] - moreTags: [String] -} ----- - -You can update both property arrays with either `_PUSH` or `_POP` operators at once: - -.Mutation with both a `_PUSH` and a `_POP` -==== -[source, graphql, indent=0] ----- -mutation { - updateMovies (update: { tags_POP: 1, moreTags_PUSH: "a different tag" }) { - movies { - title - tags - moreTags - } - } -} ----- - -[col=1,1] -|=== -| Before | After - -a| -``` - tags: ['some tag'] - moreTags: [] -``` - -a| -``` - tags: [] - moreTags ['a different tag'] -``` -|=== -==== - == Mathematical operators You can use mathematical operators to update numerical fields based on their original values in a single DB transaction.