Sha256: d922d871d096a270c96863c610f410fbc2175ea9bd5237eb31851b449e489573
Contents?: true
Size: 679 Bytes
Versions: 26
Compression:
Stored size: 679 Bytes
Contents
# A wrapper to create `__type(name: )` dynamically. class GraphQL::Introspection::TypeByNameField DEFINITION = Proc.new { |f, type, field, arg, type_hash| f.name("__type") f.description("A type in the GraphQL system") f.arguments({name: arg.build(type: !type.String)}) f.type(!GraphQL::Introspection::TypeType) f.resolve -> (o, args, c) { type_hash[args["name"]] } } def self.create(type_hash) GraphQL::Field.define do name("__type") description("A type in the GraphQL system") type(!GraphQL::Introspection::TypeType) argument :name, !types.String resolve -> (o, args, c) { type_hash[args["name"]] } end end end
Version data entries
26 entries across 26 versions & 1 rubygems