Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ast
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. case class Argument(name: String, value: Value, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends NameValue with Product with Serializable
  2. 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.

  3. sealed trait AstNode extends AnyRef

    A node in the AST of a parsed GraphQL request document.

  4. trait AstVisitor extends AnyRef
  5. case class BigDecimalValue(value: BigDecimal, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable

  6. case class BigIntValue(value: BigInt, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable

  7. case class BooleanValue(value: Boolean, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable

  8. case class Comment(text: String, location: Option[AstLocation] = None) extends AstNode with Product with Serializable
  9. sealed trait ConditionalFragment extends AstNode
  10. case class DefaultAstVisitor(onEnter: PartialFunction[AstNode, VisitorCommand] = { case _ => VisitorCommand.Continue }, onLeave: PartialFunction[AstNode, VisitorCommand] = { case _ => VisitorCommand.Continue }) extends AstVisitor with Product with Serializable
  11. 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.

    See also

    https://spec.graphql.org/June2018/#Definition

  12. 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
  13. 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
  14. case class DirectiveLocation(name: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with Product with Serializable
  15. 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.

    See also

    https://spec.graphql.org/June2018/#Document

  16. 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
  17. 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
  18. case class EnumValue(value: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable

  19. 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
  20. 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
  21. 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
  22. case class FloatValue(value: Double, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable

  23. 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
  24. case class FragmentSpread(name: String, directives: Vector[Directive], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Selection with Product with Serializable
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. case class IntValue(value: Int, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends ScalarValue with Product with Serializable

  31. 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
  32. 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
  33. case class ListType(ofType: Type, location: Option[AstLocation] = None) extends Type with Product with Serializable
  34. case class ListValue(values: Vector[Value], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable

  35. sealed trait NameValue extends AstNode with WithComments
  36. case class NamedType(name: String, location: Option[AstLocation] = None) extends Type with Product with Serializable
  37. case class NotNullType(ofType: Type, location: Option[AstLocation] = None) extends Type with Product with Serializable
  38. case class NullValue(comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable

  39. case class ObjectField(name: String, value: Value, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends NameValue with Product with Serializable
  40. sealed trait ObjectLikeTypeExtensionDefinition extends TypeExtensionDefinition
  41. 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
  42. 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
  43. case class ObjectValue(fields: Vector[ObjectField], comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable

  44. 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.

    See also

    https://spec.graphql.org/June2018/#OperationDefinition

  45. sealed trait OperationType extends AnyRef
  46. case class OperationTypeDefinition(operation: OperationType, tpe: NamedType, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends SchemaAstNode with Product with Serializable
  47. 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
  48. 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
  49. sealed trait ScalarValue extends Value

  50. sealed trait SchemaAstNode extends AstNode with WithComments
  51. 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
  52. 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
  53. sealed trait Selection extends AstNode with WithDirectives with WithComments
  54. sealed trait SelectionContainer extends AstNode with WithComments with WithTrailingComments
  55. 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

  56. sealed trait Type extends AstNode
  57. sealed trait TypeDefinition extends TypeSystemDefinition with WithDirectives with WithDescription
  58. sealed trait TypeExtensionDefinition extends TypeSystemExtensionDefinition with WithDirectives
  59. sealed trait TypeSystemDefinition extends SchemaAstNode with Definition
  60. sealed trait TypeSystemExtensionDefinition extends SchemaAstNode with Definition
  61. 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
  62. 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
  63. 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.

    See also

    https://spec.graphql.org/June2018/#Value

  64. 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.

    See also

    https://spec.graphql.org/June2018/#VariableDefinition

  65. case class VariableValue(name: String, comments: Vector[Comment] = Vector.empty, location: Option[AstLocation] = None) extends Value with Product with Serializable

  66. sealed trait WithArguments extends AstNode
  67. sealed trait WithComments extends AstNode
  68. sealed trait WithDescription extends AstNode
  69. sealed trait WithDirectives extends AstNode
  70. sealed trait WithTrailingComments extends AnyRef

Value Members

  1. object AstLocation extends Serializable
  2. object AstNode
  3. object AstVisitor
  4. object AstVisitorCommand extends Enumeration
  5. object Document extends Serializable
  6. object InputDocument extends Serializable
  7. object ObjectValue extends Serializable

  8. 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.

Ungrouped