Sha256: eb9c3f9d1f5aff1c38a91da293bc8a205c0c09bad1f1e0d144f8870af007b5e5
Contents?: true
Size: 832 Bytes
Versions: 36
Compression:
Stored size: 832 Bytes
Contents
# frozen_string_literal: true module GraphQL module Relay class Mutation # @api private module Instrumentation # Modify mutation `return_field` resolves by wrapping the returned object # in a {Mutation::Result}. # # By using an instrumention, we can apply our wrapper _last_, # giving users access to the original resolve function in earlier instrumentation. def self.instrument(type, field) if field.mutation new_resolve = Mutation::Resolve.new(field.mutation, field.resolve_proc) new_lazy_resolve = Mutation::Resolve.new(field.mutation, field.lazy_resolve_proc) field.redefine(resolve: new_resolve, lazy_resolve: new_lazy_resolve) else field end end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems