graphql_query/json/mod.rs
1//! # JSON Conversion
2//!
3//! The `graphql_query::json` module contains utilities to convert from and to `serde_json` values.
4//! Any values that are converted to `graphql_query_rs`' structures are represented as AST values.
5//! introspection data. This information may then be used to validate and introspect a schema as to
6//! possible queries that may be written against it.
7//!
8//! The [ValueFromNode] trait allows conversion to `serde_json` values using a `to_json` method on
9//! any given value. This methods converts without using any type information.
10//!
11//! The module otherwise only contains a handful of utility functions:
12//!
13//! - [ast_variables_from_value] is used to create a `Variables` map for a given JSON value.
14//! - [ast_from_value] is used to convert any given JSON value to AST values while casting it.
15//! - [ast_from_value_untyped] is used to convert any given JSON value to AST values without casting.
16//! - [value_from_ast_variables] is used to convert AST `Variables` back to a JSON value.
17//! - [value_from_ast] is used to convert a given AST value to a JSON value while filling in variables.
18
19#[cfg(feature = "json")]
20extern crate serde_json;
21
22#[cfg(feature = "json")]
23extern crate serde;
24
25mod conversion;
26mod values;
27
28pub use conversion::*;
29pub use values::*;