diff --git a/juniper/CHANGELOG.md b/juniper/CHANGELOG.md index f1d4c3c3..0b245d26 100644 --- a/juniper/CHANGELOG.md +++ b/juniper/CHANGELOG.md @@ -1,6 +1,6 @@ # master -- No changes yet +- The `ID` scalar now implements Serde's `Serialize` and `Deserialize` # [[0.12.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.12.0) diff --git a/juniper/src/types/scalars.rs b/juniper/src/types/scalars.rs index 6b969ce5..f0b8f2e0 100644 --- a/juniper/src/types/scalars.rs +++ b/juniper/src/types/scalars.rs @@ -1,3 +1,4 @@ +use serde_derive::{Deserialize, Serialize}; use std::convert::From; use std::marker::PhantomData; use std::ops::Deref; @@ -13,7 +14,7 @@ use crate::value::{ParseScalarResult, ScalarRefValue, ScalarValue, Value}; /// An ID as defined by the GraphQL specification /// /// Represented as a string, but can be converted _to_ from an integer as well. -#[derive(Clone, Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ID(String); impl From for ID {