Questions tagged [graphql-mutation]
129 questions
0
votes
1 answer
Add mutation for nested schema graphql/apollo/react
I can't add object with my app, which is based on some tutorial(however I can do it with graphql playground).
Here's my schema and use mutation in AddLaunch component.
const ADD_LAUNCH = gql`
mutation($flight_number: Int!,
$mission_name:…

Wiktor Kujawa
- 595
- 4
- 21
0
votes
0 answers
Unable to pass variable data to a GraphQL mutation
My Strapi installation has a GraphQL endpoint at https://dev.schandillia.com/graphql.
Here, I'm trying to execute the following mutation:
mutation updatePost ($id: ID!, $title: String!){
updatePost(input: {where: {id: $id}, data: {title:…

TheLearner
- 2,813
- 5
- 46
- 94
0
votes
1 answer
How do you submit an API request from the front-end based on the result of a previous API request on an Apollo graphql server?
I'm working with two API endpoints. The first one returns a list of dates in a string format for which data is available. The date can then be added to the second endpoint and renders additional data. On the Graphql Playground I have been able to…

Alex Mireles
- 121
- 1
- 7
0
votes
1 answer
How do you format your body in a fetch request for a GraphQL mutation?
I'm trying out GraphQL for the first time and I'm trying to POST some data and create a new document in a MongoDB database.
I've defined an "Office" model. Here is what a document looks like:
{
fax: 4161234567,
image: {
full:…

Michael Lynch
- 2,682
- 3
- 31
- 59
0
votes
1 answer
Multiple mutation: how to have first mutation pass ID to second mutation
Problem
Problem solved see below
I would like the ID that is created with the first mutation to be used for by the
second mutation. In this the second mutation needs the ID from the first to work.
example code:
type Order and Order_rule…

DCCW
- 195
- 3
- 12
0
votes
1 answer
What should I do when I change the status to graphql mutation?
there is member schema like following
type Member {
is_deleted
}
when i change only is_deleted field, what is the best practice change that field
using updateMember mutation that can modify all fields
using another changeDeleteStatus mutation…

fuzes
- 1,777
- 4
- 20
- 40
0
votes
1 answer
Add an array of IDs to a GraphQL mutation
I'm learning GraphQL and building an app for end users to input an insurance plan and return doctors in their area that accept the insurance they've selected. I'm attempting to push an array of "docId"s and "insId"s into my mutation, so that each…

cloudbvsting
- 3
- 2
0
votes
0 answers
Graphql mutation succeeds but displays return fields as null
I am using cassandra with graphql and express. On doing the mutation the database is updated, but it doesn't display the fields instead just shows null.
Upon using console.log to check the data and I can see it printed on terminal.
Code for…

ShreyaKse
- 45
- 6
0
votes
1 answer
Using Mutation hook to update data in Graphql server
Actually I am new to React Native. In my recent project, I have faced an issue while using useMutation hook for updating the data in my server. I have attached the file in which I am using it.
For your reference, I have attached the screenshot of…

Prabu visu
- 25
- 6
0
votes
1 answer
Cannot console.log() function in apollo server mutation
I'm working on 2 steps authentication with nexmo, I have a plan to realize this by graphl mutation because I have graphql API
and I can't get to requestId value
Mutation: {
signUpFirstStep: async ( parent, { number }, { models, secret }) =>
…

Robert
- 9
- 3
0
votes
1 answer
Handling Graphql Mutation update, cache read and writeQuery, if the query is dynamic?
Doing nightlife app on freecodecamp https://learn.freecodecamp.org/coding-interview-prep/take-home-projects/build-a-nightlife-coordination-app/
I am trying to implement 'Go' button, similarly 'Like' button on Youtube or Instagram. Users click the…

footlessbird
- 303
- 2
- 11
0
votes
1 answer
Mutating an array with apollo
I have a server side schema with this mutation type
type Mutation {
updateSettings(settings: SettingsInput): Settings
}
input SettingsInput {
repositories: [RepositoryInput]
}
input RepositoryInput {
id: String
name: String
url:…

munHunger
- 2,572
- 5
- 34
- 63
0
votes
3 answers
React native, cannot update during an existing state transition
I have a react native component. I got the error:
Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.
Code:
import....
class Register extends Component {
…

kenpeter
- 7,404
- 14
- 64
- 95
0
votes
1 answer
React apollo mutation and optimistic updates
I am using a graphql HOC with mutation for a input type of checkbox. I have also added optimistic UI update option to it. Checking the box will fire a mutation with value=true and unchecking will fire a mutation with value=false.
But the problem is…
0
votes
2 answers
GraphQL mutation that accepts an array of dynamic size in one request as input with NodeJs
I want to pass an object array of [{questionId1,value1},{questionId2,value2},{questionId3,value3}] of dynamic size in GraphQL Mutation with NodeJS
.........
args: {
input: {
type: new GraphQLNonNull(new GraphQLInputObjectType({
…

Piyush Bansal
- 1,635
- 4
- 16
- 39