Sha256: d42e9d66faf39dec49dea8d0f42cde941d5c5e179e185343d78a61a69d16de7b

Contents?: true

Size: 1.48 KB

Versions: 19

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Types
    module Relay
      # Don't use this directly, instead, use one of these:
      #
      # @example Adding this field directly
      #   include GraphQL::Types::Relay::HasNodesField
      #
      # @example Implementing a similar field in your own Query root
      #
      #   field :nodes, [GraphQL::Types::Relay::Node, null: true], null: false,
      #     description: Fetches a list of objects given a list of IDs." do
      #       argument :ids, [ID], required: true
      #     end
      #
      #   def nodes(ids:)
      #     ids.map do |id|
      #       context.schema.object_from_id(context, id)
      #     end
      #   end
      #
      def self.const_missing(const_name)
        if const_name == :NodesField
          message = "NodesField is deprecated, use `include GraphQL::Types::Relay::HasNodesField` instead."
          message += "\n(referenced from #{caller(1, 1).first})"
          GraphQL::Deprecation.warn(message)

          DeprecatedNodesField
        elsif const_name == :NodeField
          message = "NodeField is deprecated, use `include GraphQL::Types::Relay::HasNodeField` instead."
          message += "\n(referenced from #{caller(1, 1).first})"
          GraphQL::Deprecation.warn(message)

          DeprecatedNodeField
        else
          super
        end
      end
      DeprecatedNodesField = GraphQL::Schema::Field.new(owner: nil, **HasNodesField.field_options, &HasNodesField.field_block)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
graphql-1.13.23 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.22 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.21 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.20 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.19 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.18 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.17 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.16 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.15 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.14 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.13 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.12 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.11 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.10 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.9 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.8 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.7 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.6 lib/graphql/types/relay/nodes_field.rb
graphql-1.13.5 lib/graphql/types/relay/nodes_field.rb