pub enum Value {
Variable(String),
Int(i32),
Float(f64),
String(String),
Boolean(bool),
Null,
Enum(String),
List(Vec<Value>),
Object(Vec<(String, Value)>),
}
Expand description
The Value type represents available values you could give as an input.
Value: Variable | IntValue | FloatValue | StringValue | BooleanValue | NullValue | EnumValue | ListValue | ObjectValue
Detailed documentation can be found in GraphQL spec.
Variants§
Variable(String)
Name of a variable example: varName
Int(i32)
Int value example: 7
Float(f64)
Float value example: 25.4
String(String)
String value example: "My string"
Boolean(bool)
Boolean value example: false
Null
Null value example: null
Enum(String)
Enum value example: "VARIANT_EXAMPLE"
List(Vec<Value>)
List value example: [1, 2, 3]
Object(Vec<(String, Value)>)
Object value example: { first: 1, second: 2 }
Trait Implementations§
Source§impl TryFrom<DefaultValue> for Value
impl TryFrom<DefaultValue> for Value
Source§fn try_from(node: DefaultValue) -> Result<Self, Self::Error>
fn try_from(node: DefaultValue) -> Result<Self, Self::Error>
Create an apollo-encoder node from an apollo-parser one.
§Errors
This returns an error if the apollo-parser tree is not valid. The error doesn’t have much context due to TryFrom API constraints: validate the parse tree before using TryFrom if granular errors are important to you.
Source§impl TryFrom<Value> for Value
impl TryFrom<Value> for Value
Source§fn try_from(node: Value) -> Result<Self, Self::Error>
fn try_from(node: Value) -> Result<Self, Self::Error>
Create an apollo-encoder node from an apollo-parser one.
§Errors
This returns an error if the apollo-parser tree is not valid. The error doesn’t have much context due to TryFrom API constraints: validate the parse tree before using TryFrom if granular errors are important to you.