Sha256: 716be9a3f655bc3e16156fbf387ee247e10e13cc0d82605a3001eb2d6821d741
Contents?: true
Size: 516 Bytes
Versions: 8
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module GraphQL module Introspection # A wrapper to create `__type(name: )` dynamically. class TypeByNameField def self.create(schema) GraphQL::Field.define do name("__type") description("A type in the GraphQL system") type(GraphQL::Introspection::TypeType) argument :name, !types.String resolve ->(o, args, ctx) { ctx.warden.get_type(args["name"]) } end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems