Questions tagged [graphql-mutation]

129 questions
2
votes
2 answers

How to make second GraphQL mutation after first one is completed in loop

Here I've one scenario in which I have one array which has some items to add into the database via GraphQL mutation. I'm sending that mutation in a loop, and it's working fine. But when I check into my database some mismatch is happened let say I…
2
votes
1 answer

GraphQL result for another mutation

Is it meanwhile possible to use the result of a GraphQL mutation as a parameter for another mutation? I would like to create a user and his address together in one call. First I write the address and then take the address id for the creation of the…
2
votes
2 answers

How to do updates with GraphQL mutations(Hot Chocolate)

We recently introduced GraphQL to our project, I've never used it before, however I like it a lot. We decided to go with the HotChocolate library for .NET Core and Apollo for client side. One thing I am not quite sure is about mutations,…
Temp034
  • 141
  • 11
2
votes
1 answer

Nested Hasura GraphQL Upsert mutation is there a way to stop nesting on conflict?

I use Hasura and I have a social-network like situation. In which I have a "User" object and a "Feed" object. Every user has a feed. I have a relationship from user.id to feed.id. The relevant mutation is UpsertUserDetails as follows: mutation…
fokolo
  • 33
  • 3
2
votes
1 answer

Mutation based on previous value with Graphql and Amplify/AppSync

I wanna point that I am new to Graphql and I am probably missing something obvious. I would like to do something similar to a shop's order system. When a customer buys something, two things are done: (1) The money is decreased from his wallet and…
2
votes
1 answer

How to update a issue or PR comment in Github using curl and a GraphQL updateIssueComment mutation

I want to update a comment in a Github PR or issue and I found it hard to find a working example. That's why I ask this question, to answer it myself. Hopefully someone else can use this.
Konrad Kleine
  • 4,275
  • 3
  • 27
  • 35
2
votes
0 answers

Graphql_flutter runMutation's QueryResult is returning null, though the mutation is executing correctly

I'm using graphql_flutter 3.1.0 and have started the authentication for my app and am needing to set the user in my Provider state on successful creation. My mutation to CreateUser is currently: final String createUserMutation = """ mutation…
Matt Larsuma
  • 1,456
  • 4
  • 20
  • 52
2
votes
2 answers

Api-Platform graphql - create multiple items in one mutation

I have an User entity that can add his/hers contacts from Google using GooglePeopleApi. The API provides an array of contacts to the front-end as it is (Nextjs). The question is how to insert all those contacts in one single mutation. I could, of…
BernardA
  • 1,391
  • 19
  • 48
2
votes
0 answers

apollo angular how to use a nullable but required argument in mutations?

I would like to use a typescript interface for an update mutation: export interface UpdateDescription { title: string; publishedFrom: date | null; } So if null is passed as value of publishedFrom, the original date should be removed on the…
2
votes
1 answer

"Schema is not configured for mutations."

In my project I am using npm, apollo server and typeorm to set up my server. When I try to create a mutation i get this error message "Schema is not configured for mutations". I have tried searching for a solution but in all the other solutions…
Shrimpis
  • 123
  • 2
  • 8
2
votes
0 answers

Mutation to create a GIST

I want to create a gist using GitHub's GraphQL API. Although, I couldn't find the mutation to use. I tried searching for a mutation in the docs but there was none matching addGist. Is there still a way to make a POST request to create a gist using…
AMAN SHARMA
  • 331
  • 3
  • 10
1
vote
0 answers

Error: RootQueryType fields must be an object with field names as keys or a function which returns such an object

userData is just an array of object with some dummy data something like this { id: 1, first_name: "Deny", last_name: "Scrange", email: "dscrange0@paginegialle.it", Password: "268403811-2", }, So here this is just a program…
1
vote
1 answer

Cannot Return null for non-nullable type: 'String' within Parent (Error while adding a new field in the Schema)

While using a Lambda function to update using the mutation in GraphQL, the data gets updated but on subscribing it the data shows up as NULL. This Issue happens only when i make a change in the schema by adding a new Field / Column. This issue does…
Techie HV
  • 11
  • 1
1
vote
1 answer

How can we specify graphql schema to use a custom db for saving objects in Django?

Graphql Schema Mutations happen to use the default DB specified in settings.py. Since I have a Django project with multiple apps and db's , how can I specify graphql mutation to use a different db and not the default one. class…
Mansi Shah
  • 227
  • 2
  • 6
1
vote
1 answer

GraphQL mutation type thows error when try to set type

I got this error: "Mutation fields must be an object with field names as keys or a function which returns such an object." I try to add user but I don't know how to make this work. const mutation = new GraphQLObjectType({ name: "Mutation", …
FaFa
  • 358
  • 2
  • 16
1
2
3
8 9