swell/value

Types

GraphQL Value types

Per GraphQL spec Section 2 - Language, values can be scalars, enums, lists, or objects. This module defines the core Value type used throughout the GraphQL implementation. A GraphQL value that can be used in queries, responses, and variables

pub type Value {
  Null
  Int(Int)
  Float(Float)
  String(String)
  Boolean(Bool)
  Enum(String)
  List(List(Value))
  Object(List(#(String, Value)))
}

Constructors

  • Null

    Represents null/absence of a value

  • Int(Int)

    Integer value (32-bit signed integer per spec)

  • Float(Float)

    Floating point value (IEEE 754 double precision per spec)

  • String(String)

    UTF-8 string value

  • Boolean(Bool)

    Boolean true or false

  • Enum(String)

    Enum value represented as a string (e.g., “ACTIVE”, “PENDING”)

  • List(List(Value))

    Ordered list of values

  • Object(List(#(String, Value)))

    Unordered set of key-value pairs Using list of tuples for simplicity and ordering preservation

Search Document