Sha256: 46a9e49b9fff7cf0a6aa98a84767dd242a3b55d95d9375a73d59610d70c4d08c

Contents?: true

Size: 1.13 KB

Versions: 25

Compression:

Stored size: 1.13 KB

Contents

require "graphql/define/assign_argument"
require "graphql/define/assign_connection"
require "graphql/define/assign_enum_value"
require "graphql/define/assign_global_id_field"
require "graphql/define/assign_object_field"
require "graphql/define/defined_object_proxy"
require "graphql/define/instance_definable"
require "graphql/define/non_null_with_bang"
require "graphql/define/type_definer"

module GraphQL
  module Define
    # A helper for definitions that store their value in `#metadata`.
    #
    # @example Storing application classes with GraphQL types
    #   # Make a custom definition
    #   GraphQL::ObjectType.accepts_definitions(resolves_to_class_names: GraphQL::Define.assign_metadata_key(:resolves_to_class_names))
    #
    #   # After definition, read the key from metadata
    #   PostType.metadata[:resolves_to_class_names] # => [...]
    #
    # @param key [Object] the key to assign in metadata
    # @return [#call(defn, value)] an assignment for `.accepts_definitions` which writes `key` to `#metadata`
    def self.assign_metadata_key(key)
      GraphQL::Define::InstanceDefinable::AssignMetadataKey.new(key)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
graphql-0.18.9 lib/graphql/define.rb
graphql-0.18.8 lib/graphql/define.rb
graphql-0.18.7 lib/graphql/define.rb
graphql-0.18.6 lib/graphql/define.rb
graphql-0.18.5 lib/graphql/define.rb