module Oxide::Introspection
Defined in:
oxide/introspection/argument_info.croxide/introspection/directive_type.cr
oxide/introspection/enum_value_type.cr
oxide/introspection/field_info.cr
oxide/introspection/field_type.cr
oxide/introspection/input_value_type.cr
oxide/introspection/query_type.cr
oxide/introspection/schema.cr
oxide/introspection/schema_type.cr
oxide/introspection/type_type.cr
Constant Summary
-
DirectiveLocationType =
Oxide::Types::EnumType.new(name: "__DirectiveLocation", values: [Oxide::Types::EnumValue.new(name: "QUERY"), Oxide::Types::EnumValue.new(name: "MUTATION"), Oxide::Types::EnumValue.new(name: "SUBSCRIPTION"), Oxide::Types::EnumValue.new(name: "FIELD"), Oxide::Types::EnumValue.new(name: "FRAGMENT_DEFINITION"), Oxide::Types::EnumValue.new(name: "FRAGMENT_SPREAD"), Oxide::Types::EnumValue.new(name: "INLINE_FRAGMENT"), Oxide::Types::EnumValue.new(name: "SCHEMA"), Oxide::Types::EnumValue.new(name: "SCALAR"), Oxide::Types::EnumValue.new(name: "OBJECT"), Oxide::Types::EnumValue.new(name: "FIELD_DEFINITION"), Oxide::Types::EnumValue.new(name: "ARGUMENT_DEFINITION"), Oxide::Types::EnumValue.new(name: "INTERFACE"), Oxide::Types::EnumValue.new(name: "UNION"), Oxide::Types::EnumValue.new(name: "ENUM"), Oxide::Types::EnumValue.new(name: "ENUM_VALUE"), Oxide::Types::EnumValue.new(name: "INPUT_OBJECT"), Oxide::Types::EnumValue.new(name: "INPUT_FIELD_DEFINITION")])
-
DirectiveType =
Oxide::Types::ObjectType.new(name: "__Directive", fields: {"name" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::StringType.new), resolve: ->(resolution : Oxide::Resolution(Directive)) do resolution.object.name end), "description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Directive)) do nil end), "locations" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: DirectiveLocationType))), resolve: ->(resolution : Oxide::Resolution(Directive)) do resolution.object.locations.map(&.to_s) end), "args" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__InputValue")))), arguments: {"includeDeprecated" => Oxide::Argument.new(type: Oxide::Types::BooleanType.new, default_value: false)}, resolve: ->(resolution : Oxide::Resolution(Directive)) do if resolution.arguments["includeDeprecated"]? resolution.object.arguments.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end else resolution.object.arguments.reject do |_, argument| argument.deprecated? end.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end end end), "isRepeatable" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::BooleanType.new), resolve: ->(resolution : Oxide::Resolution(Directive)) do resolution.object.repeatable end)})
-
EnumValueType =
Oxide::Types::ObjectType.new(name: "__EnumValue", fields: {"name" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::StringType.new), resolve: ->(resolution : Oxide::Resolution(Types::EnumValue)) do resolution.object.name end), "description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Types::EnumValue)) do resolution.object.description end), "isDeprecated" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::BooleanType.new), resolve: ->(resolution : Oxide::Resolution(Types::EnumValue)) do resolution.object.deprecated? end), "deprecationReason" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Types::EnumValue)) do resolution.object.deprecation_reason end)})
-
FieldType =
Oxide::Types::ObjectType.new(name: "__Field", fields: {"name" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::StringType.new), resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do resolution.object.name end), "description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do resolution.object.description end), "args" => Oxide::Field.new(arguments: {"includeDeprecated" => Oxide::Argument.new(type: Oxide::Types::BooleanType.new, default_value: false)}, type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__InputValue")))), resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do if resolution.arguments["includeDeprecated"]? resolution.object.arguments.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end else resolution.object.arguments.reject do |_, argument| argument.deprecated? end.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end end end), "type" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type")), resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do resolution.object.type end), "isDeprecated" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::BooleanType.new), resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do resolution.object.deprecated? end), "deprecationReason" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(FieldInfo)) do resolution.object.deprecation_reason end)})
-
InputValueType =
Oxide::Types::ObjectType.new(name: "__InputValue", fields: {"name" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::StringType.new), resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do resolution.object.name end), "description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do resolution.object.description end), "type" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type")), resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do resolution.object.type end), "defaultValue" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do if default_value = resolution.object.default_value case default_value when String "\"#{default_value}\"" else default_value end end end), "isDeprecated" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::BooleanType.new), resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do resolution.object.deprecated? end), "deprecationReason" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(ArgumentInfo)) do resolution.object.deprecation_reason end)})
-
QueryType =
Oxide::Types::ObjectType.new(name: "__IntrospectionQuery", fields: {"__schema" => Oxide::Field.new(type: Oxide::Types::LateBoundType.new("__Schema"), resolve: ->(resolution : Oxide::Resolution(Query)) do resolution.schema end)})
-
Schema =
::Oxide::Schema.new(query: Introspection::QueryType, mutation: nil)
-
SchemaType =
Oxide::Types::ObjectType.new(name: "__Schema", fields: {"description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do nil end), "types" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type")))), resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do resolution.object.types end), "queryType" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type")), resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do resolution.object.query end), "mutationType" => Oxide::Field.new(type: Oxide::Types::LateBoundType.new("__Type"), resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do resolution.object.mutation end), "subscriptionType" => Oxide::Field.new(type: Oxide::Types::LateBoundType.new("__Type"), resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do nil end), "directives" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Directive")))), resolve: ->(resolution : Oxide::Resolution(Oxide::Schema)) do resolution.object.directives end)})
-
TypeKindType =
Oxide::Types::EnumType.new(name: "__TypeKind", values: [Oxide::Types::EnumValue.new(name: "SCALAR"), Oxide::Types::EnumValue.new(name: "OBJECT"), Oxide::Types::EnumValue.new(name: "INTERFACE"), Oxide::Types::EnumValue.new(name: "UNION"), Oxide::Types::EnumValue.new(name: "ENUM"), Oxide::Types::EnumValue.new(name: "INPUT_OBJECT"), Oxide::Types::EnumValue.new(name: "LIST"), Oxide::Types::EnumValue.new(name: "NON_NULL")])
-
TypeType =
Oxide::Types::ObjectType.new(name: "__Type", fields: {"kind" => Oxide::Field.new(type: Oxide::Types::NonNullType.new(of_type: TypeKindType), resolve: ->(resolution : Oxide::Resolution(Type)) do (resolution.object.unwrap(resolution.schema)).kind end), "name" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Type)) do (resolution.object.unwrap(resolution.schema)).name end), "description" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Type)) do (resolution.object.unwrap(resolution.schema)).description end), "fields" => Oxide::Field.new(arguments: {"includeDeprecated" => Oxide::Argument.new(type: Oxide::Types::BooleanType.new, default_value: false)}, type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Field"))), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::ObjectType, Types::InterfaceType if resolution.arguments["includeDeprecated"]? type.fields.map do |name, field| FieldInfo.new(name, field) end else type.fields.reject do |_, field| field.deprecated? end.map do |name, field| FieldInfo.new(name, field) end end end end), "interfaces" => Oxide::Field.new(type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type"))), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::ObjectType, Types::InterfaceType type.interfaces end end), "possibleTypes" => Oxide::Field.new(type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__Type"))), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::UnionType type.possible_types when Types::InterfaceType resolution.schema.not_nil!.type_map.each_with_object([] of Oxide::Type) do |__temp_63, memo| _, potential = __temp_63 if (potential.responds_to?(:interfaces)) && (potential.interfaces.includes?(type)) memo << type end end end end), "enumValues" => Oxide::Field.new(arguments: {"includeDeprecated" => Oxide::Argument.new(type: Oxide::Types::BooleanType.new, default_value: false)}, type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Introspection::EnumValueType)), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::EnumType if resolution.arguments["includeDeprecated"]? type.values else type.values.reject(&.deprecated?) end end end), "inputFields" => Oxide::Field.new(arguments: {"includeDeprecated" => Oxide::Argument.new(type: Oxide::Types::BooleanType.new, default_value: false)}, type: Oxide::Types::ListType.new(of_type: Oxide::Types::NonNullType.new(of_type: Oxide::Types::LateBoundType.new("__InputValue"))), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::InputObjectType if resolution.arguments["includeDeprecated"]? type.input_fields.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end else type.input_fields.reject do |_, argument| argument.deprecated? end.map do |name, argument| Introspection::ArgumentInfo.new(name, argument) end end end end), "ofType" => Oxide::Field.new(type: Oxide::Types::LateBoundType.new("__Type"), resolve: ->(resolution : Oxide::Resolution(Type)) do type = resolution.object.unwrap(resolution.schema) case type when Types::NonNullType, Types::ListType type.of_type end end), "specifiedByURL" => Oxide::Field.new(type: Oxide::Types::StringType.new, resolve: ->(resolution : Oxide::Resolution(Type)) do nil end)})