Sha256: e36281f03295d08f3749ef9e915f266d69c6bae19568b9ae85f350d86f57720b
Contents?: true
Size: 590 Bytes
Versions: 7
Compression:
Stored size: 590 Bytes
Contents
require 'graphql' module GraphQL module Cache # Custom field class implementation to allow for # cache config keyword parameters class Field < ::GraphQL::Schema::Field # Override #initialize to take a new argument: def initialize( *args, cache: false, **kwargs, &block ) @cache_config = cache super(*args, **kwargs, &block) end def to_graphql field_defn = super # Returns a GraphQL::Field field_defn.metadata[:cache] = @cache_config field_defn end end end end
Version data entries
7 entries across 7 versions & 1 rubygems