GQLDocument

data class GQLDocument(definitions: List<GQLDefinition>, filePath: String?) : 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

GQLDocument
Link copied to clipboard
fun GQLDocument(definitions: List<GQLDefinition>, filePath: String?)

Types

Companion
Link copied to clipboard
object Companion

Functions

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

Properties

children
Link copied to clipboard
open override val children: List<GQLDefinition>
The children of this node.
definitions
Link copied to clipboard
val definitions: List<GQLDefinition>
filePath
Link copied to clipboard
val filePath: String?
sourceLocation
Link copied to clipboard
open override val sourceLocation: SourceLocation

Extensions

validateAsExecutable
Link copied to clipboard
@ApolloExperimental()
fun GQLDocument.validateAsExecutable(schema: Schema): GQLResult<List<GQLDefinition>>
Validates the given document as an executable document.
validateAsSchema
Link copied to clipboard
@ApolloExperimental()
fun GQLDocument.validateAsSchema(): GQLResult<Schema>
  • Validate the given document as a schema.

  • Add a schema definition if there is none

  • Merge type extensions

withApolloDefinitions
Link copied to clipboard
fun GQLDocument.withApolloDefinitions(): GQLDocument
withBuiltinDefinitions
Link copied to clipboard
fun GQLDocument.withBuiltinDefinitions(): GQLDocument
withBuiltinDirectives
Link copied to clipboard
fun GQLDocument.withBuiltinDirectives(): GQLDocument
withoutBuiltinDefinitions
Link copied to clipboard
fun GQLDocument.withoutBuiltinDefinitions(): GQLDocument
withoutBuiltinDirectives
Link copied to clipboard
fun GQLDocument.withoutBuiltinDirectives(): GQLDocument