Module json

Source
Expand description

§JSON Conversion

The graphql_query::json module contains utilities to convert from and to serde_json values. Any values that are converted to graphql_query_rs’ structures are represented as AST values. introspection data. This information may then be used to validate and introspect a schema as to possible queries that may be written against it.

The ValueFromNode trait allows conversion to serde_json values using a to_json method on any given value. This methods converts without using any type information.

The module otherwise only contains a handful of utility functions:

Traits§

ValueFromNode
Trait for convertin AST Value Nodes of a GraphQL language document to serde_json::Values.

Functions§

ast_from_value
Convert serde_json::Value to an AST Value Node given a Type definition.
ast_from_value_untyped
Convert serde_json::Value to an AST Value Node without casting the JSON value to a type.
ast_variables_from_value
Convert serde_json::Value to Variables given VariableDefinitions.
value_from_ast
Convert AST Value Node back to a serde_json::Value given a Type definition.
value_from_ast_untyped
Convert AST Value Node to a serde_json::Value with given Variables.
value_from_ast_variables
Convert Variables back to a serde_json::Value.