package ast
Scala classes to represent the GraphQL AST (abstract syntax tree).
The root of the AST is the Document type, so that would be the place to start understanding the AST. The AST closely follows the specification.
- Grouped
- Alphabetic
- By Inheritance
- ast
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Argument(name: String, value: Value, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends NameValue with Product with Serializable
- case class AstLocation(sourceId: String, index: Int, line: Int, column: Int) extends Product with Serializable
A location within a GraphQL source code string.
A location within a GraphQL source code string.
- sourceId
The ID of the source code.
- index
The offset of the location as characters from the start of the source code.
- line
The line number of the location within the source code.
- column
The column number of the location within the source code.
- sealed trait AstNode extends AnyRef
A node in the AST of a parsed GraphQL request document.
- trait AstVisitor extends AnyRef
- case class BigDecimalValue(value: BigDecimal, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- case class BigIntValue(value: BigInt, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- case class BooleanValue(value: Boolean, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- case class Comment(text: String, location: Option[AstLocation] = None) extends AstNode with Product with Serializable
- sealed trait ConditionalFragment extends AstNode
- case class DefaultAstVisitor(onEnter: PartialFunction[AstNode, VisitorCommand] = { case _ => VisitorCommand.Continue }, onLeave: PartialFunction[AstNode, VisitorCommand] = { case _ => VisitorCommand.Continue }) extends AstVisitor with Product with Serializable
- sealed trait Definition extends AstNode
A definition in a GraphQL document.
A definition in a GraphQL document.
A GraphQL document consists primarily of definitions, which are either executable or representative of a GraphQL type system. The executable definitions are operation and fragment definitions; those that represent a type system fall into definition or extension categories.
- case class Directive(name: String, arguments: Vector[Argument], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends AstNode with WithArguments with Product with Serializable
- case class DirectiveDefinition(name: String, arguments: Vector[InputValueDefinition], locations: Vector[DirectiveLocation], description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeSystemDefinition with WithDescription with Product with Serializable
- case class DirectiveLocation(name: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with Product with Serializable
- case class Document(definitions: Vector[Definition], trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None, sourceMapper: Option[SourceMapper] = None) extends AstNode with WithTrailingComments with Product with Serializable
A complete GraphQL request operated on by a GraphQL service.
A complete GraphQL request operated on by a GraphQL service.
- definitions
The definitions, which primarily constitute the document.
- case class EnumTypeDefinition(name: String, values: Vector[EnumValueDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithTrailingComments with WithDescription with Product with Serializable
- case class EnumTypeExtensionDefinition(name: String, values: Vector[EnumValueDefinition], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeExtensionDefinition with WithTrailingComments with Product with Serializable
- case class EnumValue(value: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable
- case class EnumValueDefinition(name: String, directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with WithDirectives with WithDescription with Product with Serializable
- case class Field(alias: Option[String], name: String, arguments: Vector[Argument], directives: Vector[Directive], selections: Vector[Selection], comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Selection with SelectionContainer with WithArguments with Product with Serializable
- case class FieldDefinition(name: String, fieldType: Type, arguments: Vector[InputValueDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with WithDirectives with WithDescription with Product with Serializable
- case class FloatValue(value: Double, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- case class FragmentDefinition(name: String, typeCondition: NamedType, directives: Vector[Directive], selections: Vector[Selection], variables: Vector[VariableDefinition] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Definition with ConditionalFragment with WithDirectives with SelectionContainer with Product with Serializable
- case class FragmentSpread(name: String, directives: Vector[Directive], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Selection with Product with Serializable
- case class InlineFragment(typeCondition: Option[NamedType], directives: Vector[Directive], selections: Vector[Selection], comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Selection with ConditionalFragment with SelectionContainer with Product with Serializable
- case class InputDocument(values: Vector[Value], trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None, sourceMapper: Option[SourceMapper] = None) extends AstNode with WithTrailingComments with Product with Serializable
- case class InputObjectTypeDefinition(name: String, fields: Vector[InputValueDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithTrailingComments with WithDescription with Product with Serializable
- case class InputObjectTypeExtensionDefinition(name: String, fields: Vector[InputValueDefinition], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeExtensionDefinition with WithTrailingComments with Product with Serializable
- case class InputValueDefinition(name: String, valueType: Type, defaultValue: Option[Value], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with WithDirectives with WithDescription with Product with Serializable
- case class IntValue(value: Int, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- case class InterfaceTypeDefinition(name: String, fields: Vector[FieldDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithTrailingComments with WithDescription with Product with Serializable
- case class InterfaceTypeExtensionDefinition(name: String, fields: Vector[FieldDefinition], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ObjectLikeTypeExtensionDefinition with WithTrailingComments with Product with Serializable
- case class ListType(ofType: Type, location: Option[AstLocation] = None) extends Type with Product with Serializable
- case class ListValue(values: Vector[Value], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable
- sealed trait NameValue extends AstNode with WithComments
- case class NamedType(name: String, location: Option[AstLocation] = None) extends Type with Product with Serializable
- case class NotNullType(ofType: Type, location: Option[AstLocation] = None) extends Type with Product with Serializable
- case class NullValue(comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable
- case class ObjectField(name: String, value: Value, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends NameValue with Product with Serializable
- sealed trait ObjectLikeTypeExtensionDefinition extends TypeExtensionDefinition
- case class ObjectTypeDefinition(name: String, interfaces: Vector[NamedType], fields: Vector[FieldDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithTrailingComments with WithDescription with Product with Serializable
- case class ObjectTypeExtensionDefinition(name: String, interfaces: Vector[NamedType], fields: Vector[FieldDefinition], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ObjectLikeTypeExtensionDefinition with WithTrailingComments with Product with Serializable
- case class ObjectValue(fields: Vector[ObjectField], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable
- case class OperationDefinition(operationType: OperationType = OperationType.Query, name: Option[String] = None, variables: Vector[VariableDefinition] = Vector.empty, directives: Vector[Directive] = Vector.empty, selections: Vector[Selection], comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Definition with WithDirectives with SelectionContainer with Product with Serializable
A definition of a GraphQL operation.
A definition of a GraphQL operation.
Every GraphQL request invokes a specific operation, possibly with values to substitute into the operation's variables.
- name
The name of the operation. Optional only if there is only one operation in the document. Used for selecting the specific operation to invoke in a GraphQL request.
- variables
The variables that must be substituted into the operation. Values for these must be provided either by their defaults or with the GraphQL request.
- sealed trait OperationType extends AnyRef
- case class OperationTypeDefinition(operation: OperationType, tpe: NamedType, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with Product with Serializable
- case class ScalarTypeDefinition(name: String, directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithDescription with Product with Serializable
- case class ScalarTypeExtensionDefinition(name: String, directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeExtensionDefinition with Product with Serializable
- sealed trait ScalarValue extends Value
- sealed trait SchemaAstNode extends AstNode with WithComments
- case class SchemaDefinition(operationTypes: Vector[OperationTypeDefinition], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeSystemDefinition with WithDescription with WithTrailingComments with WithDirectives with Product with Serializable
- case class SchemaExtensionDefinition(operationTypes: Vector[OperationTypeDefinition], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, trailingComments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeSystemExtensionDefinition with WithDirectives with WithTrailingComments with Product with Serializable
- sealed trait Selection extends AstNode with WithDirectives with WithComments
- sealed trait SelectionContainer extends AstNode with WithComments with WithTrailingComments
- case class StringValue(value: String, block: Boolean = false, blockRawValue: Option[String] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable
- sealed trait Type extends AstNode
- sealed trait TypeDefinition extends TypeSystemDefinition with WithDirectives with WithDescription
- sealed trait TypeExtensionDefinition extends TypeSystemExtensionDefinition with WithDirectives
- sealed trait TypeSystemDefinition extends SchemaAstNode with Definition
- sealed trait TypeSystemExtensionDefinition extends SchemaAstNode with Definition
- case class UnionTypeDefinition(name: String, types: Vector[NamedType], directives: Vector[Directive] = Vector.empty, description: Option[StringValue] = None, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeDefinition with WithDescription with Product with Serializable
- case class UnionTypeExtensionDefinition(name: String, types: Vector[NamedType], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends TypeExtensionDefinition with Product with Serializable
- sealed trait Value extends AstNode with WithComments
A value that can be substituted into a GraphQL operation variable.
A value that can be substituted into a GraphQL operation variable.
Called "input values" in the GraphQL spec. Input values can be scalars, enumeration values, lists, objects, or null values.
- case class VariableDefinition(name: String, tpe: Type, defaultValue: Option[Value], directives: Vector[Directive] = Vector.empty, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends AstNode with WithComments with WithDirectives with Product with Serializable
A definition of a variable to an operation.
A definition of a variable to an operation.
- name
Name of the variable being defined.
- defaultValue
Value that the variable should assume in an operation if none was provided with the GraphQL request.
- case class VariableValue(name: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable
- sealed trait WithArguments extends AstNode
- sealed trait WithComments extends AstNode
- sealed trait WithDescription extends AstNode
- sealed trait WithDirectives extends AstNode
- sealed trait WithTrailingComments extends AnyRef
Value Members
- object AstLocation extends Serializable
- object AstNode
- object AstVisitor
- object AstVisitorCommand extends Enumeration
- object Document extends Serializable
- object InputDocument extends Serializable
- object ObjectValue extends Serializable
- object OperationType
Inherited from AnyRef
Inherited from Any
Value Nodes
Types that represent input value nodes in the GraphQL AST.
Scalar Value Nodes
Types that represent scalar input value nodes in the GraphQL AST.