Skip to content

Commit

Permalink
Revert "Support Serde Deserialization For AST"
Browse files Browse the repository at this point in the history
This reverts commit 0a1900f.
  • Loading branch information
anshap1719 committed Dec 7, 2023
1 parent 6a660e0 commit 12a1858
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/schema/ast.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::str::FromStr;
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};
use serde::Serialize;
use thiserror::Error;

pub use crate::common::{Directive, Text, Type, Value};
use crate::position::Pos;

#[derive(Debug, Clone, Default, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct Document<'a, T: Text<'a>>
where
T: Text<'a>,
Expand Down Expand Up @@ -35,7 +35,7 @@ impl<'a> Document<'a, String> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum Definition<'a, T: Text<'a>> {
SchemaDefinition(SchemaDefinition<'a, T>),
TypeDefinition(TypeDefinition<'a, T>),
Expand All @@ -44,7 +44,7 @@ pub enum Definition<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, Default, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct SchemaDefinition<'a, T: Text<'a>> {
pub position: Pos,
pub directives: Vec<Directive<'a, T>>,
Expand All @@ -54,7 +54,7 @@ pub struct SchemaDefinition<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum TypeDefinition<'a, T: Text<'a>> {
Scalar(ScalarType<'a, T>),
Object(ObjectType<'a, T>),
Expand All @@ -65,7 +65,7 @@ pub enum TypeDefinition<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum TypeExtension<'a, T: Text<'a>> {
Scalar(ScalarTypeExtension<'a, T>),
Object(ObjectTypeExtension<'a, T>),
Expand All @@ -76,7 +76,7 @@ pub enum TypeExtension<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct ScalarType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -99,7 +99,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct ScalarTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -120,7 +120,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct ObjectType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -147,7 +147,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct ObjectTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -172,7 +172,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct Field<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -183,7 +183,7 @@ pub struct Field<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct InputValue<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -194,7 +194,7 @@ pub struct InputValue<'a, T: Text<'a>> {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct InterfaceType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -221,7 +221,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct InterfaceTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -246,7 +246,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct UnionType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -271,7 +271,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct UnionTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -294,7 +294,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct EnumType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -319,7 +319,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct EnumValue<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -342,7 +342,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct EnumTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -365,7 +365,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct InputObjectType<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand All @@ -390,7 +390,7 @@ where
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct InputObjectTypeExtension<'a, T: Text<'a>> {
pub position: Pos,
pub name: T::Value,
Expand All @@ -413,7 +413,7 @@ where
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum DirectiveLocation {
// executable
Query,
Expand All @@ -440,7 +440,7 @@ pub enum DirectiveLocation {
}

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct DirectiveDefinition<'a, T: Text<'a>> {
pub position: Pos,
pub description: Option<String>,
Expand Down

0 comments on commit 12a1858

Please sign in to comment.