Macro juniper::graphql_value [−][src]
macro_rules! graphql_value { ([ $($arg:tt),* $(,)* ]) => { ... }; ({ $($key:tt : $val:tt ),* $(,)* }) => { ... }; (None) => { ... }; ($e:expr) => { ... }; }
Expand description
Construct JSON-like values by using JSON syntax
This macro can be used to create Value
instances using a JSON syntax.
Value objects are used mostly when creating custom errors from fields.
Here are some examples; the resulting JSON will look just like what you passed in.
graphql_value!(None); graphql_value!(1234); graphql_value!("test"); graphql_value!([ 1234, "test", true ]); graphql_value!({ "key": "value", "foo": 1234 });