GQLDocument

class GQLDocument(val definitions: List<GQLDefinition>, val sourceLocation: SourceLocation?) : GQLNode

The top level node in a GraphQL document. This can be a schema document or an executable document (or something else if need be)

See parseAsGQLDocument for how to obtain a GQLDocument.

Constructors

Link copied to clipboard
constructor(definitions: List<GQLDefinition>, sourceLocation: SourceLocation?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val children: List<GQLDefinition>

The children of this node.

Link copied to clipboard
Link copied to clipboard
open override val sourceLocation: SourceLocation?

Functions

Link copied to clipboard
fun copy(definitions: List<GQLDefinition> = this.definitions, sourceLocation: SourceLocation? = this.sourceLocation): GQLDocument
Link copied to clipboard
open override fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode

Internal-only. Copies this code using the given children

Link copied to clipboard
Link copied to clipboard

Returns a "full schema" document containing the built-in definitions supported by Apollo Kotlin.

Link copied to clipboard

TODO: should this be deprecated? See also the comment in WSchema. It's not clear what value there is in converting from SDL to JSON.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun GQLDocument.toSDL(indent: String = " ", includeBuiltInScalarDefinitions: Boolean = false): String

Outputs a schema document to SDL. For executable documents, use toUtf8()

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

Validates the given document as an executable document.

Link copied to clipboard
Link copied to clipboard

Add built-in definitions supported by Apollo Kotlin to the GQLDocument

Link copied to clipboard
open override fun writeInternal(writer: SDLWriter)

Internal-only. Copies this code using the given children