Module: GraphQL::Stitching

Defined in:
lib/graphql/stitching/executor/shaper.rb,
lib/graphql/stitching.rb,
lib/graphql/stitching/plan.rb,
lib/graphql/stitching/util.rb,
lib/graphql/stitching/client.rb,
lib/graphql/stitching/planner.rb,
lib/graphql/stitching/request.rb,
lib/graphql/stitching/version.rb,
lib/graphql/stitching/composer.rb,
lib/graphql/stitching/executor.rb,
lib/graphql/stitching/directives.rb,
lib/graphql/stitching/supergraph.rb,
lib/graphql/stitching/planner/step.rb,
lib/graphql/stitching/type_resolver.rb,
lib/graphql/stitching/http_executable.rb,
lib/graphql/stitching/supergraph/types.rb,
lib/graphql/stitching/type_resolver/keys.rb,
lib/graphql/stitching/executor/root_source.rb,
lib/graphql/stitching/request/skip_include.rb,
lib/graphql/stitching/composer/base_validator.rb,
lib/graphql/stitching/type_resolver/arguments.rb,
lib/graphql/stitching/supergraph/from_definition.rb,
lib/graphql/stitching/composer/validate_interfaces.rb,
lib/graphql/stitching/composer/type_resolver_config.rb,
lib/graphql/stitching/executor/type_resolver_source.rb,
lib/graphql/stitching/composer/validate_type_resolvers.rb

Overview

typed: false frozen_string_literal: true

Defined Under Namespace

Modules: Directives Classes: Client, Composer, CompositionError, DocumentError, Executor, HttpExecutable, Plan, Planner, Request, StitchingError, Supergraph, TypeResolver, Util, ValidationError

Constant Summary collapse

QUERY_OP =

scope name of query operations.

"query"
MUTATION_OP =

scope name of mutation operations.

"mutation"
SUBSCRIPTION_OP =

scope name of subscription operations.

"subscription"
TYPENAME =

introspection typename field.

"__typename"
EMPTY_OBJECT =

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

{}.freeze
EMPTY_ARRAY =

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

[].freeze
MIN_VISIBILITY_VERSION =
"2.5.3"
VERSION =
"1.7.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.stitch_directiveObject

Name of the directive used to mark type resolvers.



47
48
49
# File 'lib/graphql/stitching.rb', line 47

def stitch_directive
  @stitch_directive ||= "stitch"
end

.visibility_directiveObject

Name of the directive used to denote member visibilities.



55
56
57
# File 'lib/graphql/stitching.rb', line 55

def visibility_directive
  @visibility_directive ||= "visibility"
end

Class Method Details

.digest(&block) ⇒ Object

Proc used to compute digests; uses SHA2 by default.



37
38
39
40
41
42
43
# File 'lib/graphql/stitching.rb', line 37

def digest(&block)
  if block_given?
    @digest = block
  else
    @digest ||= ->(str) { Digest::SHA2.hexdigest(str) }
  end
end

.supports_visibility?Boolean

Returns:

  • (Boolean)


64
65
66
67
68
69
# File 'lib/graphql/stitching.rb', line 64

def supports_visibility?
  return @supports_visibility if defined?(@supports_visibility)

  # Requires `Visibility` (v2.4) with nil profile support (v2.5.3)
  @supports_visibility = Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new(MIN_VISIBILITY_VERSION)
end