data-api-builder: Mutations are not working with Apollo Client : passing variables
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,
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- adding failing test case for #296 — committed to Azure/data-api-builder by aaronpowell 2 years ago
@sajeetharan - did this work with #290 merged to
main
?