Azure / Azure/data-api-builder

Mutations are not working with Apollo Client : passing variables

Đang mở
#296 15 bình luận 0 reaction 2 người được giao Được @aaronpowell nhận Xem trên GitHub
bug cosmos has-pr
Ngôn ngữ chính
C#
Star
1.5k
Fork
370
Merge trung bình
3 ngày 22 giờ
Pull request đã merge (30 ngày)
9

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.