Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyatin committed Aug 17, 2022
1 parent bc5e9f1 commit 942373b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ A typed GraphQL client library for Rust.
- Supports setting GraphQL fields as deprecated and having the Rust compiler check
their use.
- Optional reqwest-based client for boilerplate-free API calls from browsers.
- Implicit and explicit null support.

## Getting started

Expand Down Expand Up @@ -107,6 +108,21 @@ use graphql_client::GraphQLQuery;
)]
struct UnionQuery;
```
## Implicit Null

The generated code will skip the serialization of `None` values. By default it's `false`.

```rust
use graphql_client::GraphQLQuery;

#[derive(GraphQLQuery)]
#[graphql(
schema_path = "tests/unions/union_schema.graphql",
query_path = "tests/unions/union_query.graphql",
skip_serializing_none = "true"
)]
struct UnionQuery;
```

## Custom scalars

Expand Down

0 comments on commit 942373b

Please sign in to comment.