Azure / Azure/data-api-builder

Mutations are not working with Apollo Client : passing variables

Abierto
#296 15 comentarios 0 reacciones 2 asignados Reclamado por @aaronpowell Ver en GitHub
bug cosmos has-pr
Lenguaje dominante
C#
Estrellas
1.5k
Forks
370
Merge medio
3 d 17 h
PR fusionados (30 d)
8

Descripción

I am using an Angular Client with angular-apollo https://apollo-angular.com/docs/data/mutations and Mutations are throwing an error even though the variables are passed.

This is with Cosmos DB as storage.

**Client Code :**
```
const post_SaveHero = gql`
mutation ($id : String!, $publisher : String!, $superhero :String!, $characters:String!){
addHero(id : $id , publisher : $publisher , superhero : $superhero , characters: $characters )
{
superhero
}
}`;
```
Invoking it as,

```
updateHero(hero: Hero){
console.log("$$$HERO",hero.id);
console.log("$$$HERO OBJECT",JSON.stringify(hero));
return this.apollo.mutate({
mutation: post_SaveHero,
variables: {
id: hero.superhero,
publisher: hero.publisher,
superhero: hero.superhero,
characters: hero.characters
}
}
);
}

```
and the error thrown as,

![Screenshot at Mar 14 21-17-01](https://user-images.githubusercontent.com/4833351/158308497-8b9ca237-b067-439a-a750-fe4ea8cb80be.png)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.