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

Link copied to clipboard
abstract fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode

Internal-only. Copies this code using the given children

Link copied to clipboard
abstract fun writeInternal(writer: SDLWriter)

Internal-only. Copies this code using the given children

Properties

Link copied to clipboard
abstract val children: List<GQLNode>

The children of this node.

Link copied to clipboard
abstract val sourceLocation: SourceLocation

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

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