lib/graphql/cache/fetcher.rb
def instrument(type, field)
        return field unless field.metadata[:cache]

        cached_resolve_proc = cached_resolve(type, field)

        # Return a copy of `field`, with the new resolve proc
        field.redefine { resolve(cached_resolve_proc) }
      end
# Redefines the given field's resolve proc to use our
# custom cache wrapping resolver proc. Called from
# graphql-ruby internals. This is the "instrumenter"
# entrypoint.
#
# @param type [GraphQL::Schema::Object] graphql-ruby passes the defined type for the field being instrumented
# @param field [GraphQL::Schema::Field] graphql-ruby passes the field definition to be re-defined
# @return [GraphQL::Schema::Field]
Redefines the given field's resolve proc to use our
custom cache wrapping resolver proc. Called from
graphql-ruby internals. This is the "instrumenter"
entrypoint.
Redefines the given field ' s resolve proc to use our custom cache wrapping resolver proc . Called from graphql - ruby internals . This is the " instrumenter " entrypoint .
def instrument(type, field)
        return field unless field.metadata[:cache]
        cached_resolve_proc = cached_resolve(type, field)
        field.redefine { resolve(cached_resolve_proc) }
      end
def instrument ( type , field ) return field unless field . metadata [ :cache ] cached_resolve_proc = cached_resolve ( type , field ) field . redefine { resolve ( cached_resolve_proc ) } end
Redefines the given field's resolve proc to use our
custom cache wrapping resolver proc.
Redefines the given field ' s resolve proc to use our custom cache wrapping resolver proc .
# Return a copy of `field`, with the new resolve proc
None
GraphQL::Schema::Field
type
graphql-ruby passes the defined type for the field being instrumented
graphql - ruby passes the defined type for the field being instrumented
field
graphql-ruby passes the field definition to be re-defined
graphql - ruby passes the field definition to be re - defined