Sha256: 3503f0ce806f801a7a1475f4fce194f1618364b543d3e1ea9ff20a83ff9d3b47
Contents?: true
Size: 915 Bytes
Versions: 17
Compression:
Stored size: 915 Bytes
Contents
# frozen_string_literal: true module GraphQL module Types module Relay # This can be used for implementing `Query.nodes(ids: ...)`, # or use it for inspiration for your own field definition. # # @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 # NodesField = GraphQL::Schema::Field.new(owner: nil, **HasNodesField.field_options, &HasNodesField.field_block) end end end
Version data entries
17 entries across 17 versions & 2 rubygems