Questions tagged [graphql-mutation]

129 questions
1
vote
0 answers

graphql.error.syntax_error.GraphQLSyntaxError: Syntax Error: Expected Name, found '{'

I am using streamlit to build a frontend for doing crud operations. The backend API is a neo4j graphql API and I am trying to do mutations from the form data in streamlit. I am receiving this error below.I was unable to rectify this error need…
1
vote
1 answer

Request structure of event sent from appsync to lambda

JSON request sent from appSync to AWS lambda on mutation When we create a mutation request from appsynch to lambda resolver below JSON structure is passed as a event to lambda. Could you please suggest best way to capture the event in lambda…
Ajay
  • 176
  • 6
1
vote
0 answers

Bad Request for an omitted field in GQL

I'm getting "Bad request" response with message "roleId must be a string" when running a mutation. I don't know why since the "roleId" field is optional. Schema input CustomerUpdateInput { name: String roleId:…
g_m
  • 456
  • 1
  • 3
  • 12
1
vote
1 answer

Many-to-many mutation resolver for Apollo GraphQL

I have 2 entities: Peas and Pods. They have an implicit many-to-many relationship. At the moment, I'm trying to add already created Peas to a Pod on creation. Here is my current resolver: addPod: async (parent, args, context) => { return…
JSim
  • 117
  • 5
1
vote
1 answer

Can I make multiple useMutation in a components

I have a question about using multiple mutation in a component. For example, if I need to create and update the same component, how can I make them? When I make like const [createUser, {data}] = useMtation(CREATE_USER, {user}) - create user const…
ReactCodeMan
  • 77
  • 2
  • 8
1
vote
0 answers

Use django-taggit package with graphene mutations

I'm using the package django-taggit with graphene-django. Initially, I was getting the error specified in this question (Don't know how to convert the Django field skills (); but thanks to the answers there,…
1
vote
0 answers

Apollo Mutation fail with Strapi & React Native setup

Hope you're doing well ? I'm facing an issue with Apollo Client querying a Strapi API. I've created the following mutation : export const POST_MOBILE_USER = gql` mutation CreateMobileUser( $first_name: String! $isOnboarded: Boolean! …
1
vote
0 answers

Can I implement mutations with gatsby-source-moltin plugin?

As you have read in the title I am trying to add data through graphql (mutations) with this plugin. This is my code: mutation{ allMoltinProduct (id:"d348fcc5-3e1c-5ebb-a1bb-9a4716bb56af",name:"Camiseta",formatted:"7.49"){ edges { node { …
L3G3ND
  • 32
  • 4
1
vote
0 answers

Implementing a nested mutation based on a relationship between two GraphQL types

I want to create a form that allows me to create a value from a nested field. Root values in the same mutation work ok, but when I want to create the nested value, I cannot. Take for instance the below mutation. export const createPremise =…
Shingai Munyuki
  • 551
  • 1
  • 11
  • 25
1
vote
1 answer

Error Cannot return null for non-nullable type: 'String' within parent MyModelType' (/createMyModelType/id)

I am trying to trigger a mutation in the aws console. I have linked my resolver function to a None type data source. However, when I define my mutation with an input type as a parameter, the error " Error Cannot return null for non-nullable type:…
1
vote
1 answer

Keystone next custom graphql mutation and external frontend

Hey I am trying to get a custom mutation to work in keystone-next with a "external" react, next & apollo frontend, but I am getting issues when calling the mutation from the frontend, but not when when calling it from the Keystone api explorer. The…
1
vote
1 answer

Executing a Mutation with GraphQL in Google App Script

function Run_Mutation(){ var token = "Bearer [Censored]" var Business_ID = "[Censored]" var url = "https://gql.waveapps.com/graphql/public"; var query = "mutation Mutation($input: CustomerCreateInput!) {\ customerCreate(input:…
1
vote
1 answer

Error: Identifier already been declared. How can it be resolved?

I am using Grapgql for querying in React application. I have a query & mutation, both in the same component. Because of this, the variables defined error & data is repeated. Therefore it is showing an error in React as Identifiers already…
1
vote
1 answer

GraphQL nested document returns null on mutation

I am using MongoDB with Mongoose and GraphQL for a class project. I am stuck on an issue with GraphQL returning null on fields within a nested document reference (postedBy which references the User schema). I expect the fields to be populated by the…
Craig5117
  • 55
  • 6
1
vote
1 answer

React-Apollo error: "...only supports a query, subscription, or a mutation per HOC"

I am trying to create two separate mutations in this format: import gql from 'graphql-tag'; const MUTATION = gql` mutation setItem($item:String!) { setItem(item:$item) }, mutation setAnotherItem($setAnotherItem:Bool) { …
jay
  • 13
  • 3
1 2
3
8 9