Questions tagged [mutation]

Mutation refers to a genetic operator used to maintain genetic diversity from one generation of a population to the next. For javascript DOM, use [mutation-observers]. For Java mutators, use [mutators]. For object mutability in general, use [mutability].

557 questions
5
votes
1 answer

GraphQL: best way to manage mutations with interfaces?

I'am new to GraphQL but I really like it. Now that I'am playing with interfaces and unions, I'am facing a problem with mutations. Suppose that I have this schema : interface FoodType { id: String type: String } type Pizza implements FoodType { …
Fred Mériot
  • 4,157
  • 9
  • 33
  • 50
5
votes
1 answer

Vuex - expose mutations only to actions

I would like to use Vuex to store state about my client-server communication, e.g. a search logic: // status is either synching|synched|error state: { query:"", result:[], status:"synching" } I implement the search action. Actions can only modify…
nagy.zsolt.hun
  • 6,292
  • 12
  • 56
  • 95
5
votes
1 answer

How to mutate a list of custom objects in GraphQL for .NET

Using GraphQL for .NET, I would like to replace the collection of Foo with a new collection. Given this server-side code: public class Foo { public Foo(string name) { Name = name; } public string Name { get; set; } } public…
Daniel Robinson
  • 2,165
  • 17
  • 14
5
votes
3 answers

graphql - use queries in mutations - create a nested object

I have a very simple model with post that embeds several comments I wondered how I should do a mutation to add a new comment to the post As I already have queries defined to get back a postwith a given id, I wanted to try to have the following…
Martin Ratinaud
  • 600
  • 5
  • 12
5
votes
2 answers

Restore Node/Element after it has been modified/removed from DOM

I am in need of a way to detect if any DOM Node/Element has been removed or modified and instantly restore that element to the state in which it was before. I tried to "backup" the body node and set the body.innerHTML to its original state every…
SpoonGuy
  • 75
  • 2
  • 4
4
votes
0 answers

How to call API asynchronously based on other API response using using React useQuery and useHook mutations?

I am calling two API's, getOperator and second is getPlans after data recieved from getOperator API. getOperator take phone_number as input and give two values in response - { operator: 'AT&T', circle: 'Washington' } const[phoneNumber,…
4
votes
1 answer

Mutation function returned by useMutation not passing variables

I'm trying to use the mutation function returned by the useMutation hook to create a user (later on I have to make a log in mutation as well) but the variables passed on the createUser() function are not being passed. This is my code for the sign up…
4
votes
1 answer

How dangerous is it to mutate a Vue prop by the child?

Vue allows to mutate props but it is not recommended. In the docs (https://vuejs.org/guide/components/props.html#one-way-data-flow) I found that As a best practice, you should avoid such mutations [mutating nested props by the child] unless the…
VeGoh5i
  • 51
  • 2
4
votes
0 answers

413 Payload Too Large -- Unable to Solve using Other Solutions

I keep sporadically getting this error, fixing it, and then getting it again. I followed the instructions for the highest voted answer on this following question, and it didn't work unfortunately. I have a pretty concise server.js file, so I'm…
user17306847
4
votes
0 answers

Variables value not passed to GraphQL Mutation (React)

I have been stuck on this bug for now a while, so any help would be much appreciated!! :) I am building a web app with: Backend server running with Spring Boot Frontend server running with React/TypeScript/GraphQL So far I have managed to make…
Come.T
  • 91
  • 1
  • 4
4
votes
1 answer

Vuex - update object in mutation

After the user clicks a button I want to replace the data in my vuex store with the data from my local object. But I am stuck at the mutation. Here is some code for more details. This is the method that is called after the user clicks a…
HTLWelsITLover99
  • 199
  • 1
  • 4
  • 10
4
votes
1 answer

Proper error handling when performing multiple mutations in graphql

Given the following GraphQL mutations: type Mutation { updateUser(id: ID!, newEmail: String!): User updatePost(id: ID!, newTitle: String!): Post } The Apollo docs state that it's totally possible to perform multiple mutations in one request,…
lenny.myr
  • 903
  • 2
  • 11
  • 20
4
votes
3 answers

Vue + Vuex: input value not set by store if no store change