Sha256: 09ae76625f4450023fc3f330144b91cde4f422e775df4a2ebef9f18e820aff8d

Contents?: true

Size: 827 Bytes

Versions: 16

Compression:

Stored size: 827 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Types
    module Relay
      # This can be used for implementing `Query.node(id: ...)`,
      # or use it for inspiration for your own field definition.
      #
      # @example Adding this field directly
      #   include GraphQL::Types::Relay::HasNodeField
      #
      # @example Implementing a similar field in your own Query root
      #
      #   field :node, GraphQL::Types::Relay::Node, null: true,
      #     description: "Fetches an object given its ID" do
      #       argument :id, ID, required: true
      #     end
      #
      #   def node(id:)
      #     context.schema.object_from_id(id, context)
      #   end
      #
      NodeField = GraphQL::Schema::Field.new(owner: nil, **HasNodeField.field_options, &HasNodeField.field_block)
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
graphql_cody-1.13.0 lib/graphql/types/relay/node_field.rb
graphql-1.12.24 lib/graphql/types/relay/node_field.rb
graphql-1.12.23 lib/graphql/types/relay/node_field.rb
graphql-1.13.2 lib/graphql/types/relay/node_field.rb
graphql-1.13.1 lib/graphql/types/relay/node_field.rb
graphql-1.12.22 lib/graphql/types/relay/node_field.rb
graphql-1.13.0 lib/graphql/types/relay/node_field.rb
graphql-1.12.21 lib/graphql/types/relay/node_field.rb
graphql-1.12.20 lib/graphql/types/relay/node_field.rb
graphql-1.12.19 lib/graphql/types/relay/node_field.rb
graphql-1.12.18 lib/graphql/types/relay/node_field.rb
graphql-1.12.17 lib/graphql/types/relay/node_field.rb
graphql-1.12.16 lib/graphql/types/relay/node_field.rb
graphql-1.12.15 lib/graphql/types/relay/node_field.rb
graphql-1.12.14 lib/graphql/types/relay/node_field.rb
graphql-1.12.13 lib/graphql/types/relay/node_field.rb