Class: GraphQL::Language::DocumentFromSchemaDefinition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/language/document_from_schema_definition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

DocumentFromSchemaDefinition is used to convert a Schema object To a Document AST node.

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ DocumentFromSchemaDefinition

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DocumentFromSchemaDefinition.



10
11
12
13
# File 'lib/graphql/language/document_from_schema_definition.rb', line 10

def initialize(schema)
  @schema = schema
  @types = GraphQL::Schema::Traversal.new(schema, introspection: true).type_map.values
end

Instance Method Details

#documentObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
18
19
# File 'lib/graphql/language/document_from_schema_definition.rb', line 15

def document
  GraphQL::Language::Nodes::Document.new(
    definitions: build_definition_nodes
  )
end