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-1.2.6 lib/graphql/define.rb
graphql-1.2.5 lib/graphql/define.rb
graphql-1.2.4 lib/graphql/define.rb
graphql-1.2.3 lib/graphql/define.rb
graphql-1.2.2 lib/graphql/define.rb
graphql-1.2.1 lib/graphql/define.rb
graphql-1.2.0 lib/graphql/define.rb
graphql-1.1.0 lib/graphql/define.rb
graphql-1.0.0 lib/graphql/define.rb
graphql-0.19.4 lib/graphql/define.rb
graphql-0.19.3 lib/graphql/define.rb
graphql-0.19.2 lib/graphql/define.rb
graphql-0.19.1 lib/graphql/define.rb
graphql-0.19.0 lib/graphql/define.rb
graphql-0.18.15 lib/graphql/define.rb
graphql-0.18.14 lib/graphql/define.rb
graphql-0.18.13 lib/graphql/define.rb
graphql-0.18.12 lib/graphql/define.rb
graphql-0.18.11 lib/graphql/define.rb
graphql-0.18.10 lib/graphql/define.rb