Class: GraphQL::Schema::MiddlewareChain

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/models/monkey_patches/graphql_schema_middleware_chain.rb

Overview

Monkey patch… there will soon be a PR in graphql-ruby for this functionality, Talked with the gem author (@rmosolgo) and he said it was a good feature, so likely to land soon

Instance Method Summary collapse

Instance Method Details

#call(next_arguments = @arguments) ⇒ Object



4
5
6
7
8
9
# File 'lib/graphql/models/monkey_patches/graphql_schema_middleware_chain.rb', line 4

def call(next_arguments = @arguments)
  @arguments = next_arguments
  next_step = steps.shift
  next_middleware = self
  next_step.call(*arguments, next_middleware)
end