Sha256: d8db1d5424101984804be169a17fba9ced6689833d622caa8917780f537a99ed
Contents?: true
Size: 815 Bytes
Versions: 13
Compression:
Stored size: 815 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 # add_field(GraphQL::Types::Relay::NodeField) # # @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(**HasNodeField.field_options, &HasNodeField.field_block) end end end
Version data entries
13 entries across 13 versions & 1 rubygems