graphql-dotnet / graphql-dotnet/graphql-client

Boolean serialization error

Open
#128 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
648
Forks
136
PR merge metrics
No merged PRs in 30d

Description

I'm trying to send this mutation:

```C#
GraphQLRequest graphQLRequest = new GraphQLRequest()
{
Query = @"mutation(
$order_code: Int!,
$industry_code: String!,
$wholesaler_code: String!,
$wholesaler_order_code: String,
$payment_term: String,
$consideration: String,
$is_free_good_discount: Boolean,
$processed_at: String!,
$invoice_at: String,
$products: [ResponseProductInput]!) {
createResponse(
order_code: $order_code,
industry_code: $industry_code,
wholesaler_code: $wholesaler_code,
wholesaler_order_code: $wholesaler_order_code,
payment_term: $payment_term,
consideration: $consideration,
is_free_good_discount: $is_free_good_discount,
processed_at: $processed_at,
invoice_at: $invoice_at,
products: $products
)
{
id,
outcome,
content,
imported_at
}
}",
Variables = new
{
orderResponse.order_code,
orderResponse.industry_code,
orderResponse.wholesaler_code,
orderResponse.wholesaler_order_code,
orderResponse.payment_term,
orderResponse.consideration,
orderResponse.is_free_good_discount,
orderResponse.processed_at,
orderResponse.invoice_at,
orderResponse.products
}
};
```

The attribute **is_free_good_discount** is a Boolean type with **false** value.

But when I send this request, the response is always:
> **Variable "$is_free_good_discount" got invalid value "0"; Expected type Boolean; Cannot represent value as boolean: 0**

If I inspect the request with Fiddler, _is_free_good_discount_ value is "false"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.