Class: GraphQL::Stitching::Plan::Op

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/stitching/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(step:, after:, location:, operation_type:, selections:, variables: nil, path: nil, if_type: nil, resolver: nil) ⇒ Op

Returns a new instance of Op.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/graphql/stitching/plan.rb', line 19

def initialize(
  step:,
  after:,
  location:,
  operation_type:,
  selections:,
  variables: nil,
  path: nil,
  if_type: nil,
  resolver: nil
)
  @step = step
  @after = after
  @location = location
  @operation_type = operation_type
  @selections = selections
  @variables = variables
  @path = path
  @if_type = if_type
  @resolver = resolver
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



10
11
12
# File 'lib/graphql/stitching/plan.rb', line 10

def after
  @after
end

#if_typeObject (readonly)

Returns the value of attribute if_type.



16
17
18
# File 'lib/graphql/stitching/plan.rb', line 16

def if_type
  @if_type
end

#locationObject (readonly)

Returns the value of attribute location.



11
12
13
# File 'lib/graphql/stitching/plan.rb', line 11

def location
  @location
end

#operation_typeObject (readonly)

Returns the value of attribute operation_type.



12
13
14
# File 'lib/graphql/stitching/plan.rb', line 12

def operation_type
  @operation_type
end

#pathObject (readonly)

Returns the value of attribute path.



15
16
17
# File 'lib/graphql/stitching/plan.rb', line 15

def path
  @path
end

#resolverObject (readonly)

Returns the value of attribute resolver.



17
18
19
# File 'lib/graphql/stitching/plan.rb', line 17

def resolver
  @resolver
end

#selectionsObject (readonly)

Returns the value of attribute selections.



13
14
15
# File 'lib/graphql/stitching/plan.rb', line 13

def selections
  @selections
end

#stepObject (readonly)

Returns the value of attribute step.



9
10
11
# File 'lib/graphql/stitching/plan.rb', line 9

def step
  @step
end

#variablesObject (readonly)

Returns the value of attribute variables.



14
15
16
# File 'lib/graphql/stitching/plan.rb', line 14

def variables
  @variables
end

Instance Method Details

#==(other) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/graphql/stitching/plan.rb', line 55

def ==(other)
  step == other.step &&
    after == other.after &&
    location == other.location &&
    operation_type == other.operation_type &&
    selections == other.selections &&
    variables == other.variables &&
    path == other.path &&
    if_type == other.if_type &&
    resolver == other.resolver
end

#as_jsonObject



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/graphql/stitching/plan.rb', line 41

def as_json
  {
    step: step,
    after: after,
    location: location,
    operation_type: operation_type,
    selections: selections,
    variables: variables,
    path: path,
    if_type: if_type,
    resolver: resolver
  }.tap(&:compact!)
end