Sha256: 304b9e958fe07b69d4d32ff05185834fbb0e077861311589d6f9142f4318b762

Contents?: true

Size: 1.4 KB

Versions: 40

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true
GraphQL::Introspection::SchemaType = GraphQL::ObjectType.define do
  name "__Schema"
  description "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all "\
              "available types and directives on the server, as well as the entry points for "\
              "query, mutation, and subscription operations."

  field :types, !types[!GraphQL::Introspection::TypeType], "A list of all types supported by this server." do
    resolve ->(obj, arg, ctx) { ctx.warden.types }
  end

  field :queryType, !GraphQL::Introspection::TypeType, "The type that query operations will be rooted at." do
    resolve ->(obj, arg, ctx) { ctx.warden.root_type_for_operation("query") }
  end

  field :mutationType, GraphQL::Introspection::TypeType, "If this server supports mutation, the type that mutation operations will be rooted at." do
    resolve ->(obj, arg, ctx) { ctx.warden.root_type_for_operation("mutation") }
  end

  field :subscriptionType, GraphQL::Introspection::TypeType, "If this server support subscription, the type that subscription operations will be rooted at." do
    resolve ->(obj, arg, ctx) { ctx.warden.root_type_for_operation("subscription") }
  end

  field :directives, !types[!GraphQL::Introspection::DirectiveType], "A list of all directives supported by this server." do
    resolve ->(obj, arg, ctx) { obj.directives.values }
  end

  introspection true
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
graphql-1.7.14 lib/graphql/introspection/schema_type.rb
graphql-1.7.13 lib/graphql/introspection/schema_type.rb
graphql-1.7.12 lib/graphql/introspection/schema_type.rb
graphql-1.7.11 lib/graphql/introspection/schema_type.rb
graphql-1.7.10 lib/graphql/introspection/schema_type.rb
graphql-1.7.9 lib/graphql/introspection/schema_type.rb
graphql-1.7.8 lib/graphql/introspection/schema_type.rb
graphql-1.8.0.pre2 lib/graphql/introspection/schema_type.rb
graphql-1.7.7 lib/graphql/introspection/schema_type.rb
graphql-1.8.0.pre1 lib/graphql/introspection/schema_type.rb
graphql-1.7.6 lib/graphql/introspection/schema_type.rb
graphql-1.7.5 lib/graphql/introspection/schema_type.rb
graphql-1.7.4 lib/graphql/introspection/schema_type.rb
graphql-1.7.3 lib/graphql/introspection/schema_type.rb
graphql-1.7.2 lib/graphql/introspection/schema_type.rb
graphql-1.7.1 lib/graphql/introspection/schema_type.rb
graphql-1.7.0 lib/graphql/introspection/schema_type.rb
graphql-1.6.8 lib/graphql/introspection/schema_type.rb
graphql-1.6.7 lib/graphql/introspection/schema_type.rb
graphql-1.6.6 lib/graphql/introspection/schema_type.rb