Class: ElasticGraph::SchemaArtifacts::RuntimeMetadata::ConfiguredGraphQLResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver.rb

Constant Summary collapse

NAME =
"name"
CONFIG =
"config"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



20
21
22
23
24
25
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver.rb', line 20

def self.from_hash(hash)
  new(
    name: hash.fetch(NAME).to_sym,
    config: Support::HashUtil.symbolize_keys(hash[CONFIG] || {})
  )
end

Instance Method Details

#to_dumpable_hashObject



27
28
29
30
31
32
33
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver.rb', line 27

def to_dumpable_hash
  {
    # Keys here are ordered alphabetically; please keep them that way.
    CONFIG => Support::HashUtil.stringify_keys(config),
    NAME => name.to_s
  }.reject { |_, v| v.empty? }
end