File tree Expand file tree Collapse file tree 1 file changed +0
-50
lines changed 
modules/ROOT/pages/mutations Expand file tree Collapse file tree 1 file changed +0
-50
lines changed Original file line number Diff line number Diff line change 394394|=== 
395395==== 
396396
397- === Mixing `_PUSH` and `_POP`
398- 
399- It is possible to perform both a `_PUSH` and `_POP` operation in one single `update` mutation.
400- 
401- Consider the following type definitions:
402- 
403- [source, graphql, indent=0]
404- ---- 
405- type Movie @node { 
406-     title: String 
407-     tags: [String] 
408-     moreTags: [String] 
409- } 
410- ---- 
411- 
412- You can update both property arrays with either `_PUSH` or `_POP` operators at once:
413- 
414- .Mutation with both a `_PUSH` and a `_POP` 
415- ==== 
416- [source, graphql, indent=0] 
417- ---- 
418- mutation { 
419-     updateMovies (update: { tags_POP: 1, moreTags_PUSH: "a different tag" }) { 
420-         movies { 
421-             title 
422-             tags 
423-             moreTags 
424-         } 
425-     } 
426- } 
427- ---- 
428- 
429- [col=1,1] 
430- |=== 
431- | Before | After 
432- 
433- a| 
434- ``` 
435-     tags: ['some tag'] 
436-     moreTags: [] 
437- ``` 
438- 
439- a| 
440- ``` 
441-     tags: [] 
442-     moreTags ['a different tag'] 
443- ``` 
444- |=== 
445- ==== 
446- 
447397== Mathematical operators
448398
449399You can use mathematical operators to update numerical fields based on their original values in a single DB transaction.
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments