GQLNode

interface GQLNode

A node in the GraphQL AST.

The structure of the different nodes matches closely the one of the GraphQL specification (https://spec.graphql.org/June2018/#sec-Appendix-Grammar-Summary.Document)

Compared to the Antlr com.apollographql.apollo3.generated.antlr.GraphQLParser.DocumentContext, a GQLDocument is a lot simpler and allows for easy modifying a document (using GQLNode.transform) and outputing them to a okio.BufferedSink.

Whitespace tokens are not mapped to GQLNodes so some formatting will be lost during modification

Functions

copyWithNewChildrenInternal
Link copied to clipboard
abstract fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode
Internal-only.
writeInternal
Link copied to clipboard
abstract fun writeInternal(writer: SDLWriter)
Internal-only.

Properties

children
Link copied to clipboard
abstract val children: List<GQLNode>
The children of this node.
sourceLocation
Link copied to clipboard
abstract val sourceLocation: SourceLocation

Inheritors

GQLDefinition
Link copied to clipboard
GQLTypeSystemExtension
Link copied to clipboard
GQLSelection
Link copied to clipboard
GQLDocument
Link copied to clipboard
GQLEnumValueDefinition
Link copied to clipboard
GQLFieldDefinition
Link copied to clipboard
GQLInputValueDefinition
Link copied to clipboard
GQLVariableDefinition
Link copied to clipboard
GQLOperationTypeDefinition
Link copied to clipboard
GQLDirective
Link copied to clipboard
GQLObjectField
Link copied to clipboard
GQLArgument
Link copied to clipboard
GQLSelectionSet
Link copied to clipboard
GQLArguments
Link copied to clipboard
GQLType
Link copied to clipboard
GQLValue
Link copied to clipboard

Extensions

toUtf8
Link copied to clipboard
fun GQLNode.toUtf8(sink: BufferedSink, indent: String = " ")
fun GQLNode.toUtf8(file: File, indent: String = " ")
fun GQLNode.toUtf8(indent: String = " "): String
transform
Link copied to clipboard
fun GQLNode.transform(transformer: NodeTransformer): GQLNode?