Add `#[non_exhaustive]` attribute to Request/Response types

This commit is contained in:
Sunli 2022-04-19 10:21:56 +08:00
parent 300cbe54c7
commit 6cf0496a35
3 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# [4.0.0] 2022-4-19
- Add `#[non_exhaustive]` attribute to Request/Response types.
- Introduce ability to pre-parse Request's query. [#891](https://github.com/async-graphql/async-graphql/pull/891)
# [3.0.38] 2022-4-8
- Update Axum integration to Axum 0.5.1 [#883](https://github.com/async-graphql/async-graphql/pull/883)

View File

@ -12,6 +12,7 @@ use crate::{Data, ParseRequestError, ServerError, UploadValue, Value, Variables}
///
/// This can be deserialized from a structure of the query string, the operation name and the
/// variables. The names are all in `camelCase` (e.g. `operationName`).
#[non_exhaustive]
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Request {

View File

@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize};
use crate::{CacheControl, Result, ServerError, Value};
/// Query response
#[non_exhaustive]
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
pub struct Response {
/// Data of query result