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 398398|=== 
399399==== 
400400
401- === Mixing `_PUSH` and `_POP`
402- 
403- It is possible to perform both a `_PUSH` and `_POP` operation in one single `update` mutation.
404- 
405- Consider the following type definitions:
406- 
407- [source, graphql, indent=0]
408- ---- 
409- type Movie { 
410-     title: String 
411-     tags: [String] 
412-     moreTags: [String] 
413- } 
414- ---- 
415- 
416- You can update both property arrays with either `_PUSH` or `_POP` operators at once:
417- 
418- .Mutation with both a `_PUSH` and a `_POP` 
419- ==== 
420- [source, graphql, indent=0] 
421- ---- 
422- mutation { 
423-     updateMovies (update: { tags_POP: 1, moreTags_PUSH: "a different tag" }) { 
424-         movies { 
425-             title 
426-             tags 
427-             moreTags 
428-         } 
429-     } 
430- } 
431- ---- 
432- 
433- [col=1,1] 
434- |=== 
435- | Before | After 
436- 
437- a| 
438- ``` 
439-     tags: ['some tag'] 
440-     moreTags: [] 
441- ``` 
442- 
443- a| 
444- ``` 
445-     tags: [] 
446-     moreTags ['a different tag'] 
447- ``` 
448- |=== 
449- ==== 
450- 
451401== Mathematical operators
452402
453403You 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