Class: ElasticGraph::GraphQL::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/graphql/client.rb

Overview

Represents a client of an ElasticGraph GraphQL endpoint. ‘name` and `source_description` can really be any string, but `name` is meant to be a friendly/human readable string (such as a service name) where as `source_description` is meant to be an opaque string describing where `name` came from.

Defined Under Namespace

Classes: DefaultResolver

Constant Summary collapse

ANONYMOUS =
new("(anonymous)", "(anonymous)")
ELASTICGRAPH_INTERNAL =
new("(ElasticGraphInternal)", "(ElasticGraphInternal)")

Instance Method Summary collapse

Constructor Details

#initialize(source_description:, name:, extra_opaque_id_parts: []) ⇒ Client

‘Data.define` provides the following methods:



20
21
22
# File 'lib/elastic_graph/graphql/client.rb', line 20

def initialize(source_description:, name:, extra_opaque_id_parts: [])
  super
end

Instance Method Details

#descriptionObject



24
25
26
27
28
29
30
# File 'lib/elastic_graph/graphql/client.rb', line 24

def description
  if source_description == name
    name
  else
    "#{name} (#{source_description})"
  end
end