Module: GraphQL::Schema::BuildFromDefinition

Defined in:
lib/graphql/schema/build_from_definition.rb,
lib/graphql/schema/build_from_definition/resolve_map.rb,
lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb

Defined Under Namespace

Classes: ResolveMap

Class Method Summary collapse

Class Method Details

.from_definition(definition_string, parser: GraphQL.default_parser, **kwargs) ⇒ Object

See Also:

  • {Schema{Schema.from_definition}

13
14
15
# File 'lib/graphql/schema/build_from_definition.rb', line 13

def from_definition(definition_string, parser: GraphQL.default_parser, **kwargs)
  from_document(parser.parse(definition_string), **kwargs)
end

.from_definition_path(definition_path, parser: GraphQL.default_parser, **kwargs) ⇒ Object


17
18
19
# File 'lib/graphql/schema/build_from_definition.rb', line 17

def from_definition_path(definition_path, parser: GraphQL.default_parser, **kwargs)
  from_document(parser.parse_file(definition_path), **kwargs)
end

.from_document(document, default_resolve:, using: {}, relay: false, interpreter: true) ⇒ Object


21
22
23
# File 'lib/graphql/schema/build_from_definition.rb', line 21

def from_document(document, default_resolve:, using: {}, relay: false, interpreter: true)
  Builder.build(document, default_resolve: default_resolve || {}, relay: relay, using: using, interpreter: interpreter)
end