Azure / Azure/data-api-builder

Mutations are not working with Apollo Client : passing variables

未关闭
#296 15 条评论 0 个 reaction 已指派 2 人 已被 @aaronpowell 认领 在 GitHub 查看
bug cosmos has-pr
主要语言
C#
星标
1.5k
派生
370
平均合并
3 天 22 小时
30 天内合并 PR
9

描述

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)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。