Sha256: 0e1a84a826dcde48ef17cfd2877210c4b6459d9a9f12892f6522d07365094471

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

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) { obj.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) { obj.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) { obj.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
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
graphql-1.2.6 lib/graphql/introspection/schema_type.rb
graphql-1.2.5 lib/graphql/introspection/schema_type.rb
graphql-1.2.4 lib/graphql/introspection/schema_type.rb
graphql-1.2.3 lib/graphql/introspection/schema_type.rb
graphql-1.2.2 lib/graphql/introspection/schema_type.rb
graphql-1.2.1 lib/graphql/introspection/schema_type.rb
graphql-1.2.0 lib/graphql/introspection/schema_type.rb
graphql-1.1.0 lib/graphql/introspection/schema_type.rb