From 7f98c6685239f6c779667a7bf0de37aa42b5e8b0 Mon Sep 17 00:00:00 2001 From: Greg MacWilliam Date: Mon, 8 Jun 2026 10:51:16 -0400 Subject: [PATCH] add sorbet typechecking. --- .github/workflows/ci.yml | 14 + Gemfile | 5 + Rakefile | 5 + bin/tapioca | 16 + lib/graphql/stitching.rb | 57 +- lib/graphql/stitching/client.rb | 41 +- lib/graphql/stitching/composer.rb | 323 +- .../stitching/composer/base_validator.rb | 4 +- .../composer/type_resolver_config.rb | 25 +- .../stitching/composer/validate_interfaces.rb | 9 +- .../composer/validate_type_resolvers.rb | 25 +- lib/graphql/stitching/executor.rb | 36 +- lib/graphql/stitching/executor/path_access.rb | 19 +- lib/graphql/stitching/executor/root_source.rb | 17 +- lib/graphql/stitching/executor/shaper.rb | 27 +- .../executor/type_resolver_source.rb | 37 +- lib/graphql/stitching/http_executable.rb | 51 +- lib/graphql/stitching/plan.rb | 45 +- lib/graphql/stitching/planner.rb | 122 +- lib/graphql/stitching/planner/step.rb | 62 +- lib/graphql/stitching/request.rb | 103 +- lib/graphql/stitching/request/skip_include.rb | 19 +- lib/graphql/stitching/supergraph.rb | 85 +- .../stitching/supergraph/from_definition.rb | 29 +- lib/graphql/stitching/supergraph/types.rb | 12 +- lib/graphql/stitching/type_resolver.rb | 36 +- .../stitching/type_resolver/arguments.rb | 76 +- lib/graphql/stitching/type_resolver/keys.rb | 69 +- lib/graphql/stitching/util.rb | 61 +- sorbet/config | 6 + sorbet/rbi/annotations/.gitattributes | 1 + sorbet/rbi/annotations/graphql.rbi | 55 + sorbet/rbi/annotations/minitest.rbi | 120 + sorbet/rbi/gems/.gitattributes | 1 + sorbet/rbi/gems/graphql@2.6.3.rbi | 19806 ++++++++++++++++ sorbet/rbi/gems/minitest@5.27.0.rbi | 1499 ++ sorbet/rbi/shims/graphql_stitching.rbi | 82 + sorbet/tapioca/config.yml | 41 + sorbet/tapioca/require.rb | 4 + .../composer/expand_abstract_type_test.rb | 65 + test/graphql/stitching/util_test.rb | 18 - 41 files changed, 22595 insertions(+), 533 deletions(-) create mode 100755 bin/tapioca create mode 100644 sorbet/config create mode 100644 sorbet/rbi/annotations/.gitattributes create mode 100644 sorbet/rbi/annotations/graphql.rbi create mode 100644 sorbet/rbi/annotations/minitest.rbi create mode 100644 sorbet/rbi/gems/.gitattributes create mode 100644 sorbet/rbi/gems/graphql@2.6.3.rbi create mode 100644 sorbet/rbi/gems/minitest@5.27.0.rbi create mode 100644 sorbet/rbi/shims/graphql_stitching.rbi create mode 100644 sorbet/tapioca/config.yml create mode 100644 sorbet/tapioca/require.rb create mode 100644 test/graphql/stitching/composer/expand_abstract_type_test.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9702bb8..37b4b960 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,3 +39,17 @@ jobs: gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 bundle exec rake test + + typecheck: + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: Gemfile + steps: + - uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + bundler-cache: true + - name: Run typecheck + run: bundle exec rake typecheck diff --git a/Gemfile b/Gemfile index 566711e0..1e81d0bd 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,11 @@ source 'https://rubygems.org' gemspec +group :development do + gem 'sorbet', require: false + gem 'tapioca', require: false +end + gem 'pry' gem 'pry-byebug' gem 'warning' diff --git a/Rakefile b/Rakefile index 1e28f6a0..c2cb1e58 100644 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,11 @@ namespace :benchmark do end end +desc "Run Sorbet typecheck" +task :typecheck do + sh "bundle exec srb tc" +end + desc "Run benchmarks" task benchmark: "benchmark:planner" diff --git a/bin/tapioca b/bin/tapioca new file mode 100755 index 00000000..82de9af2 --- /dev/null +++ b/bin/tapioca @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'tapioca' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("tapioca", "tapioca") diff --git a/lib/graphql/stitching.rb b/lib/graphql/stitching.rb index 37887c47..4a86d2bd 100644 --- a/lib/graphql/stitching.rb +++ b/lib/graphql/stitching.rb @@ -1,39 +1,42 @@ # frozen_string_literal: true +# typed: true require "graphql" module GraphQL module Stitching - # scope name of query operations. - QUERY_OP = "query" - - # scope name of mutation operations. - MUTATION_OP = "mutation" - - # scope name of subscription operations. - SUBSCRIPTION_OP = "subscription" - - # introspection typename field. - TYPENAME = "__typename" - - # @api private - EMPTY_OBJECT = {}.freeze - - # @api private - EMPTY_ARRAY = [].freeze + QUERY_OP = "query".freeze #: String + + MUTATION_OP = "mutation".freeze #: String + + SUBSCRIPTION_OP = "subscription".freeze #: String + + TYPENAME = "__typename".freeze #: String + + EMPTY_OBJECT = {}.freeze #: Hash[untyped, untyped] + + EMPTY_ARRAY = [].freeze #: Array[untyped] class StitchingError < StandardError; end class CompositionError < StitchingError; end class ValidationError < CompositionError; end class DocumentError < StandardError + #: (String element) -> void def initialize(element) super("Invalid #{element} encountered in document") end end + MIN_VISIBILITY_VERSION = "2.5.3".freeze #: String + class << self - # Proc used to compute digests; uses SHA2 by default. - # @returns [Proc] proc used to compute digests. + # @rbs! + # @digest: ^(String) -> String + # @stitch_directive: String + # @visibility_directive: String + # @supports_visibility: bool + + #: ?{ (String) -> String } -> ^(String) -> String def digest(&block) if block_given? @digest = block @@ -42,25 +45,23 @@ def digest(&block) end end - # Name of the directive used to mark type resolvers. - # @returns [String] name of the type resolver directive. + #: -> String def stitch_directive - @stitch_directive ||= "stitch" + @stitch_directive ||= "stitch".freeze end + #: String attr_writer :stitch_directive - # Name of the directive used to denote member visibilities. - # @returns [String] name of the visibility directive. + #: -> String def visibility_directive - @visibility_directive ||= "visibility" + @visibility_directive ||= "visibility".freeze end + #: String attr_writer :visibility_directive - MIN_VISIBILITY_VERSION = "2.5.3" - - # @returns Boolean true if GraphQL::Schema::Visibility is fully supported + #: -> bool def supports_visibility? return @supports_visibility if defined?(@supports_visibility) diff --git a/lib/graphql/stitching/client.rb b/lib/graphql/stitching/client.rb index f57d702d..a25eac77 100644 --- a/lib/graphql/stitching/client.rb +++ b/lib/graphql/stitching/client.rb @@ -1,25 +1,22 @@ # frozen_string_literal: true +# typed: true require "json" module GraphQL module Stitching - # Client is an out-of-the-box helper that assembles all - # stitching components into a workflow that executes requests. class Client class << self + #: (String | singleton(GraphQL::Schema) schema, executables: Hash[Location | Symbol, Executable]) -> Client def from_definition(schema, executables:) new(supergraph: Supergraph.from_definition(schema, executables: executables)) end end - # @return [Supergraph] composed supergraph that services incoming requests. + #: Supergraph attr_reader :supergraph - # Builds a new client instance. Either `supergraph` or `locations` configuration is required. - # @param supergraph [Supergraph] optional, a pre-composed supergraph that bypasses composer setup. - # @param locations [Hash>] optional, composer configurations for each graph location. - # @param composer_options [Hash] optional, composer options for configuring composition. + #: (?locations: untyped, ?supergraph: Supergraph?, ?composer_options: Hash[Symbol, untyped]) -> void def initialize(locations: nil, supergraph: nil, composer_options: {}) @supergraph = if locations && supergraph raise ArgumentError, "Cannot provide both locations and a supergraph." @@ -34,15 +31,26 @@ def initialize(locations: nil, supergraph: nil, composer_options: {}) composer.perform(locations) end - @on_cache_read = nil - @on_cache_write = nil - @on_error = nil + @on_cache_read = nil #: CacheReadHandler? + @on_cache_write = nil #: CacheWriteHandler? + @on_error = nil #: ErrorHandler? end + #: ( + #| ?String | DocumentNode | nil raw_query, + #| ?query: String | DocumentNode | nil, + #| ?variables: Variables?, + #| ?operation_name: String?, + #| ?context: untyped, + #| ?validate: bool + #| ) -> untyped def execute(raw_query = nil, query: nil, variables: nil, operation_name: nil, context: nil, validate: true) + source = raw_query || query + raise ArgumentError, "A query string or document is required." unless source + request = Request.new( @supergraph, - raw_query || query, # << for parity with GraphQL Ruby Schema.execute + source, operation_name: operation_name, variables: variables, context: context, @@ -62,23 +70,27 @@ def execute(raw_query = nil, query: nil, variables: nil, operation_name: nil, co error_result(request, [{ "message" => custom_message || "An unexpected error occured." }]) end + #: ?{ (Request) -> String? } -> CacheReadHandler def on_cache_read(&block) - raise ArgumentError, "A cache read block is required." unless block_given? + raise ArgumentError, "A cache read block is required." unless block @on_cache_read = block end + #: ?{ (Request, String) -> void } -> CacheWriteHandler def on_cache_write(&block) - raise ArgumentError, "A cache write block is required." unless block_given? + raise ArgumentError, "A cache write block is required." unless block @on_cache_write = block end + #: ?{ (Request?, StandardError) -> String? } -> ErrorHandler def on_error(&block) - raise ArgumentError, "An error handler block is required." unless block_given? + raise ArgumentError, "An error handler block is required." unless block @on_error = block end private + #: (Request request) -> Plan def load_plan(request) if @on_cache_read && plan_json = @on_cache_read.call(request) plan = Plan.from_json(JSON.parse(plan_json)) @@ -98,6 +110,7 @@ def load_plan(request) plan end + #: (Request? request, Array[PublicErrorObject | PublicError] errors) -> GraphQL::Query::Result def error_result(request, errors) public_errors = errors.map! do |e| e.is_a?(Hash) ? e : e.to_h diff --git a/lib/graphql/stitching/composer.rb b/lib/graphql/stitching/composer.rb index 0652d6b3..332b5b0b 100644 --- a/lib/graphql/stitching/composer.rb +++ b/lib/graphql/stitching/composer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require_relative "composer/base_validator" require_relative "composer/validate_interfaces" @@ -7,11 +8,7 @@ module GraphQL module Stitching - # Composer receives many individual `GraphQL::Schema` instances - # representing various graph locations and merges them into one - # combined Supergraph that is validated for integrity. class Composer - # @api private NO_DEFAULT_VALUE = begin t = Class.new(GraphQL::Schema::Object) do field(:f, String) { _1.argument(:a, String) } @@ -20,33 +17,42 @@ class Composer t.get_field("f").get_argument("a").default_value end - # @api private BASIC_VALUE_MERGER = ->(values_by_location, _info) { values_by_location.values.find { !_1.nil? } } - - # @api private + VISIBILITY_PROFILES_MERGER = ->(values_by_location, _info) { values_by_location.values.reduce(:&) } - # @api private COMPOSITION_VALIDATORS = [ ValidateInterfaces, ValidateTypeResolvers, ].freeze - # @return [String] name of the Query type in the composed schema. + #: TypeName attr_reader :query_name - # @return [String] name of the Mutation type in the composed schema. + #: TypeName attr_reader :mutation_name - # @return [String] name of the Subscription type in the composed schema. + #: TypeName attr_reader :subscription_name - # @api private + #: Hash[TypeName, Hash[Location, untyped]]? attr_reader :subgraph_types_by_name_and_location - # @api private + #: Hash[String, untyped]? attr_reader :schema_directives + #: ( + #| ?query_name: TypeName, + #| ?mutation_name: TypeName, + #| ?subscription_name: TypeName, + #| ?visibility_profiles: Array[String], + #| ?description_merger: untyped, + #| ?deprecation_merger: untyped, + #| ?default_value_merger: untyped, + #| ?directive_kwarg_merger: untyped, + #| ?root_field_location_selector: untyped, + #| ?root_entrypoints: Hash[String, Location]? + #| ) -> void def initialize( query_name: "Query", mutation_name: "Mutation", @@ -62,23 +68,24 @@ def initialize( @query_name = query_name @mutation_name = mutation_name @subscription_name = subscription_name - @description_merger = description_merger || BASIC_VALUE_MERGER - @deprecation_merger = deprecation_merger || BASIC_VALUE_MERGER - @default_value_merger = default_value_merger || BASIC_VALUE_MERGER - @directive_kwarg_merger = directive_kwarg_merger || BASIC_VALUE_MERGER - @root_field_location_selector = root_field_location_selector - @root_entrypoints = root_entrypoints || {} + @description_merger = description_merger || BASIC_VALUE_MERGER #: untyped + @deprecation_merger = deprecation_merger || BASIC_VALUE_MERGER #: untyped + @default_value_merger = default_value_merger || BASIC_VALUE_MERGER #: untyped + @directive_kwarg_merger = directive_kwarg_merger || BASIC_VALUE_MERGER #: untyped + @root_field_location_selector = root_field_location_selector #: untyped + @root_entrypoints = root_entrypoints || {} #: Hash[String, Location] - @field_map = {} - @resolver_map = {} - @resolver_configs = {} - @mapped_type_names = {} - @visibility_profiles = Set.new(visibility_profiles) - @subgraph_directives_by_name_and_location = nil - @subgraph_types_by_name_and_location = nil - @schema_directives = nil + @field_map = {} #: LocationsByTypeAndField + @resolver_map = {} #: TypeResolverMap + @resolver_configs = {} #: Hash[String, Array[TypeResolverConfig]] + @mapped_type_names = {} #: Hash[TypeName, TypeName] + @visibility_profiles = Set.new(visibility_profiles) #: Set[String] + @subgraph_directives_by_name_and_location = nil #: Hash[String, Hash[Location, untyped]]? + @subgraph_types_by_name_and_location = nil #: Hash[TypeName, Hash[Location, untyped]]? + @schema_directives = nil #: Hash[String, untyped]? end + #: (Hash[Location | Symbol, Hash[Symbol, untyped]] locations_input) -> Supergraph def perform(locations_input) if @subgraph_types_by_name_and_location raise CompositionError, "Composer may only perform once per instance." @@ -94,24 +101,24 @@ def perform(locations_input) ] # "directive_name" => "location" => subgraph_directive - @subgraph_directives_by_name_and_location = schemas.each_with_object({}) do |(location, schema), memo| + subgraph_directives_by_name_and_location = schemas.each_with_object({}) do |(location, schema), memo| (schema.directives.keys - schema.default_directives.keys - directives_to_omit).each do |directive_name| memo[directive_name] ||= {} memo[directive_name][location] = schema.directives[directive_name] end end + @subgraph_directives_by_name_and_location = subgraph_directives_by_name_and_location # "directive_name" => merged_directive - @schema_directives = @subgraph_directives_by_name_and_location.each_with_object({}) do |(directive_name, directives_by_location), memo| + schema_directives = subgraph_directives_by_name_and_location.each_with_object({}) do |(directive_name, directives_by_location), memo| memo[directive_name] = build_directive(directive_name, directives_by_location) end - @schema_directives.merge!(GraphQL::Schema.default_directives) + schema_directives.merge!(GraphQL::Schema.default_directives) + @schema_directives = schema_directives # "Typename" => "location" => subgraph_type - @subgraph_types_by_name_and_location = schemas.each_with_object({}) do |(location, schema), memo| - raise CompositionError, "Location keys must be strings" unless location.is_a?(String) - + subgraph_types_by_name_and_location = schemas.each_with_object({}) do |(location, schema), memo| schema.types.each do |type_name, subgraph_type| next if subgraph_type.introspection? @@ -132,11 +139,12 @@ def perform(locations_input) memo[type_name][location] = subgraph_type end end + @subgraph_types_by_name_and_location = subgraph_types_by_name_and_location enum_usage = build_enum_usage_map(schemas.values) # "Typename" => merged_type - schema_types = @subgraph_types_by_name_and_location.each_with_object({}) do |(type_name, types_by_location), memo| + schema_types = subgraph_types_by_name_and_location.each_with_object({}) do |(type_name, types_by_location), memo| kinds = types_by_location.values.map { _1.kind.name }.tap(&:uniq!) if kinds.length > 1 @@ -171,7 +179,7 @@ def perform(locations_input) query schema_types[builder.query_name] mutation schema_types[builder.mutation_name] subscription schema_types[builder.subscription_name] - directives builder.schema_directives.values + directives schema_directives.values object_types.each do |t| t.interfaces.each { _1.orphan_types(t) } @@ -197,8 +205,7 @@ def perform(locations_input) supergraph end - # @!scope class - # @!visibility private + #: (Hash[Location | Symbol, Hash[Symbol, untyped]] locations_input) -> [Hash[Location, singleton(GraphQL::Schema)], Hash[Location, Executable]] def prepare_locations_input(locations_input) schemas = {} executables = {} @@ -212,32 +219,41 @@ def prepare_locations_input(locations_input) raise CompositionError, "The schema for `#{location}` location must be a GraphQL::Schema class." end + location = location.to_s @resolver_configs.merge!(TypeResolverConfig.extract_directive_assignments(schema, location, input[:stitch])) @resolver_configs.merge!(TypeResolverConfig.extract_federation_entities(schema, location)) - schemas[location.to_s] = schema - executables[location.to_s] = input[:executable] || schema + schemas[location] = schema + executables[location] = input[:executable] || schema end return schemas, executables end - # @!scope class - # @!visibility private + #: (String directive_name, Hash[Location, untyped] directives_by_location) -> untyped def build_directive(directive_name, directives_by_location) builder = self Class.new(GraphQL::Schema::Directive) do graphql_name(directive_name) - description(builder.merge_descriptions(directive_name, directives_by_location)) + description(builder.merged_description(directive_name, directives_by_location)) repeatable(directives_by_location.values.any?(&:repeatable?)) - locations(*directives_by_location.values.flat_map(&:locations).tap(&:uniq!)) + builder.apply_directive_locations(self, directives_by_location) builder.build_merged_arguments(directive_name, directives_by_location, self, directive_name: directive_name) end end - # @!scope class - # @!visibility private + #: (Hash[Location, untyped] directives_by_location) -> Array[untyped] + def merged_directive_locations(directives_by_location) + directives_by_location.values.flat_map(&:locations).tap(&:uniq!) + end + + #: (untyped directive_class, Hash[Location, untyped] directives_by_location) -> void + def apply_directive_locations(directive_class, directives_by_location) + directive_class.locations(*merged_directive_locations(directives_by_location)) + end + + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> untyped def build_scalar_type(type_name, types_by_location) built_in_type = GraphQL::Schema::BUILT_IN_TYPES[type_name] return built_in_type if built_in_type @@ -246,13 +262,12 @@ def build_scalar_type(type_name, types_by_location) Class.new(GraphQL::Stitching::Supergraph::ScalarType) do graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) + description(builder.merged_description(type_name, types_by_location)) builder.build_merged_directives(type_name, types_by_location, self) end end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location, Hash[TypeName, Array[Symbol]] enum_usage) -> untyped def build_enum_type(type_name, types_by_location, enum_usage) builder = self @@ -273,7 +288,7 @@ def build_enum_type(type_name, types_by_location, enum_usage) Class.new(GraphQL::Stitching::Supergraph::EnumType) do graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) + description(builder.merged_description(type_name, types_by_location)) builder.build_merged_directives(type_name, types_by_location, self) enum_values_by_name_location.each do |value_name, enum_values_by_location| @@ -288,14 +303,13 @@ def build_enum_type(type_name, types_by_location, enum_usage) end end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> untyped def build_object_type(type_name, types_by_location) builder = self Class.new(GraphQL::Stitching::Supergraph::ObjectType) do graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) + description(builder.merged_description(type_name, types_by_location)) interface_names = types_by_location.values.flat_map { _1.interfaces.map(&:graphql_name) } interface_names.tap(&:uniq!).each do |interface_name| @@ -307,74 +321,80 @@ def build_object_type(type_name, types_by_location) end end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> untyped def build_interface_type(type_name, types_by_location) builder = self - Module.new do - include GraphQL::Stitching::Supergraph::InterfaceType - graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) - - interface_names = types_by_location.values.flat_map { _1.interfaces.map(&:graphql_name) } - interface_names.tap(&:uniq!).each do |interface_name| - implements(builder.build_type_binding(interface_name)) - end + interface_type = Module.new #: untyped + interface_type.include GraphQL::Stitching::Supergraph::InterfaceType + interface_type.graphql_name(type_name) + interface_type.description(builder.merged_description(type_name, types_by_location)) - builder.build_merged_fields(type_name, types_by_location, self) - builder.build_merged_directives(type_name, types_by_location, self) + interface_names = types_by_location.values.flat_map { _1.interfaces.map(&:graphql_name) } + interface_names.tap(&:uniq!).each do |interface_name| + interface_type.implements(builder.build_type_binding(interface_name)) end + + builder.build_merged_fields(type_name, types_by_location, interface_type) + builder.build_merged_directives(type_name, types_by_location, interface_type) + + interface_type end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> untyped def build_union_type(type_name, types_by_location) builder = self Class.new(GraphQL::Stitching::Supergraph::UnionType) do graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) + description(builder.merged_description(type_name, types_by_location)) possible_names = types_by_location.values.flat_map { _1.possible_types.map(&:graphql_name) }.tap(&:uniq!) - possible_types(*possible_names.map { builder.build_type_binding(_1) }) + builder.apply_possible_types(self, possible_names) builder.build_merged_directives(type_name, types_by_location, self) end end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> untyped def build_input_object_type(type_name, types_by_location) builder = self Class.new(GraphQL::Stitching::Supergraph::InputObjectType) do graphql_name(type_name) - description(builder.merge_descriptions(type_name, types_by_location)) + description(builder.merged_description(type_name, types_by_location)) builder.build_merged_arguments(type_name, types_by_location, self) builder.build_merged_directives(type_name, types_by_location, self) end end - # @!scope class - # @!visibility private + #: (TypeName type_name) -> GraphQL::Schema::LateBoundType def build_type_binding(type_name) GraphQL::Schema::LateBoundType.new(@mapped_type_names.fetch(type_name, type_name)) end - # @!scope class - # @!visibility private + #: (Array[TypeName] possible_names) -> Array[GraphQL::Schema::LateBoundType] + def possible_type_bindings(possible_names) + possible_names.map { build_type_binding(_1) } + end + + #: (untyped union_type, Array[TypeName] possible_names) -> void + def apply_possible_types(union_type, possible_names) + union_type.possible_types(*possible_type_bindings(possible_names)) + end + + #: (TypeName type_name, Hash[Location, untyped] types_by_location, untyped owner) -> void def build_merged_fields(type_name, types_by_location, owner) # "field_name" => "location" => field - fields_by_name_location = types_by_location.each_with_object({}) do |(location, subgraph_type), memo| - @field_map[type_name] ||= {} - subgraph_type.fields.each do |field_name, subgraph_field| - @field_map[type_name][subgraph_field.name] ||= [] - @field_map[type_name][subgraph_field.name] << location - - memo[field_name] ||= {} - memo[field_name][location] = subgraph_field + field_locations_by_name = @field_map[type_name] ||= {} + fields_by_name_location = types_by_location.each_with_object({}) do |(location, subgraph_type), memo| + subgraph_type.fields.each do |field_name, subgraph_field| + field_locations_by_name[subgraph_field.name] ||= [] + field_locations_by_name.fetch(subgraph_field.name) << location + + memo[field_name] ||= {} + memo[field_name][location] = subgraph_field + end end - end fields_by_name_location.each do |field_name, fields_by_location| value_types = fields_by_location.values.map(&:type) @@ -395,8 +415,13 @@ def build_merged_fields(type_name, types_by_location, owner) end end - # @!scope class - # @!visibility private + #: ( + #| TypeName type_name, + #| Hash[Location, untyped] members_by_location, + #| untyped owner, + #| ?field_name: FieldName?, + #| ?directive_name: String? + #| ) -> void def build_merged_arguments(type_name, members_by_location, owner, field_name: nil, directive_name: nil) # "argument_name" => "location" => argument args_by_name_location = members_by_location.each_with_object({}) do |(location, subgraph_member), memo| @@ -447,8 +472,14 @@ def build_merged_arguments(type_name, members_by_location, owner, field_name: ni end end - # @!scope class - # @!visibility private + #: ( + #| TypeName type_name, + #| Hash[Location, untyped] members_by_location, + #| untyped owner, + #| ?field_name: FieldName?, + #| ?argument_name: String?, + #| ?enum_value: String? + #| ) -> void def build_merged_directives(type_name, members_by_location, owner, field_name: nil, argument_name: nil, enum_value: nil) directives_by_name_location = members_by_location.each_with_object({}) do |(location, subgraph_member), memo| subgraph_member.directives.each do |directive| @@ -459,7 +490,7 @@ def build_merged_directives(type_name, members_by_location, owner, field_name: n directives_by_name_location.each do |directive_name, directives_by_location| kwarg_merger = @directive_kwarg_merger - directive_class = @schema_directives[directive_name] + directive_class = @schema_directives&.[](directive_name) next unless directive_class # handled by deprecation_reason merger... @@ -500,31 +531,34 @@ def build_merged_directives(type_name, members_by_location, owner, field_name: n end end - # @!scope class - # @!visibility private + #: (TypeName type_name, Array[untyped] subgraph_types, ?field_name: FieldName?, ?argument_name: String?) -> untyped def merge_value_types(type_name, subgraph_types, field_name: nil, argument_name: nil) path = [type_name, field_name, argument_name].tap(&:compact!).join(".") alt_structures = subgraph_types.map { Util.flatten_type_structure(_1) } - basis_structure = alt_structures.shift + basis_structure = alt_structures.fetch(0) + alt_structures = alt_structures.drop(1) alt_structures.each do |alt_structure| if alt_structure.length != basis_structure.length raise CompositionError, "Cannot compose mixed list structures at `#{path}`." end - if alt_structure.last.name != basis_structure.last.name + if alt_structure.fetch(-1).name != basis_structure.fetch(-1).name raise CompositionError, "Cannot compose mixed types at `#{path}`." end end + type_name = basis_structure.fetch(-1).name + raise CompositionError, "Cannot compose unnamed type at `#{path}`." unless type_name + type = GraphQL::Schema::BUILT_IN_TYPES.fetch( - basis_structure.last.name, - build_type_binding(basis_structure.last.name) + type_name, + build_type_binding(type_name) ) basis_structure.reverse!.each_with_index do |basis, index| rev_index = basis_structure.length - index - 1 - non_null = alt_structures.each_with_object([basis.non_null?]) { |s, m| m << s[rev_index].non_null? } + non_null = alt_structures.each_with_object([basis.non_null?]) { |s, m| m << s.fetch(rev_index).non_null? } type = type.to_list_type if basis.list? type = type.to_non_null_type if argument_name ? non_null.any? : non_null.all? @@ -533,8 +567,7 @@ def merge_value_types(type_name, subgraph_types, field_name: nil, argument_name: type end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] members_by_location, ?field_name: FieldName?, ?argument_name: String?, ?enum_value: String?) -> String? def merge_descriptions(type_name, members_by_location, field_name: nil, argument_name: nil, enum_value: nil) strings_by_location = members_by_location.each_with_object({}) { |(l, m), memo| memo[l] = m.description } @description_merger.call(strings_by_location, { @@ -545,8 +578,18 @@ def merge_descriptions(type_name, members_by_location, field_name: nil, argument }.tap(&:compact!)) end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] members_by_location, ?field_name: FieldName?, ?argument_name: String?, ?enum_value: String?) -> String + def merged_description(type_name, members_by_location, field_name: nil, argument_name: nil, enum_value: nil) + merge_descriptions( + type_name, + members_by_location, + field_name: field_name, + argument_name: argument_name, + enum_value: enum_value, + ).to_s + end + + #: (TypeName type_name, Hash[Location, untyped] members_by_location, ?field_name: FieldName?, ?argument_name: String?, ?enum_value: String?) -> String? def merge_deprecations(type_name, members_by_location, field_name: nil, argument_name: nil, enum_value: nil) strings_by_location = members_by_location.each_with_object({}) { |(l, m), memo| memo[l] = m.deprecation_reason } @deprecation_merger.call(strings_by_location, { @@ -557,8 +600,7 @@ def merge_deprecations(type_name, members_by_location, field_name: nil, argument }.tap(&:compact!)) end - # @!scope class - # @!visibility private + #: (TypeName type_name, Hash[Location, untyped] types_by_location) -> void def extract_resolvers(type_name, types_by_location) types_by_location.each do |location, subgraph_type| subgraph_type.fields.each do |field_name, subgraph_field| @@ -583,9 +625,12 @@ def extract_resolvers(type_name, types_by_location) resolver_type.graphql_name end + subgraph_types_by_name_and_location = @subgraph_types_by_name_and_location + raise CompositionError, "Composer has no subgraph types." unless subgraph_types_by_name_and_location + key = TypeResolver.parse_key_with_types( config.key, - @subgraph_types_by_name_and_location[resolver_type_name], + subgraph_types_by_name_and_location.fetch(resolver_type_name), ) arguments_format = config.arguments || begin @@ -607,11 +652,11 @@ def extract_resolvers(type_name, types_by_location) arguments.each { _1.verify_key(key) } @resolver_map[resolver_type_name] ||= [] - @resolver_map[resolver_type_name] << TypeResolver.new( + @resolver_map.fetch(resolver_type_name) << TypeResolver.new( location: location, type_name: resolver_type_name, field: subgraph_field.name, - list: resolver_structure.first.list?, + list: resolver_structure.fetch(0).list?, key: key, arguments: arguments, ) @@ -620,12 +665,11 @@ def extract_resolvers(type_name, types_by_location) end end - # @!scope class - # @!visibility private + #: (singleton(GraphQL::Schema) schema) -> void def select_root_field_locations(schema) [schema.query, schema.mutation, schema.subscription].tap(&:compact!).each do |root_type| root_type.fields.each do |root_field_name, root_field| - root_field_locations = @field_map[root_type.graphql_name][root_field_name] + root_field_locations = @field_map.fetch(root_type.graphql_name).fetch(root_field_name) next unless root_field_locations.length > 1 root_field_path = "#{root_type.graphql_name}.#{root_field_name}" @@ -649,26 +693,56 @@ def select_root_field_locations(schema) end end - # @!scope class - # @!visibility private + #: (singleton(GraphQL::Schema) composed_schema, Hash[Location, singleton(GraphQL::Schema)] schemas_by_location) -> void def expand_abstract_resolvers(composed_schema, schemas_by_location) @resolver_map.keys.each do |type_name| next unless composed_schema.get_type(type_name).kind.abstract? - @resolver_map[type_name].each do |resolver| - abstract_type = @subgraph_types_by_name_and_location[type_name][resolver.location] - expanded_types = Util.expand_abstract_type(schemas_by_location[resolver.location], abstract_type) + @resolver_map.fetch(type_name).each do |resolver| + subgraph_types_by_name_and_location = @subgraph_types_by_name_and_location + raise CompositionError, "Composer has no subgraph types." unless subgraph_types_by_name_and_location + + abstract_type = subgraph_types_by_name_and_location.fetch(type_name).fetch(resolver.location) + expanded_types = expand_abstract_type(schemas_by_location.fetch(resolver.location), abstract_type) - expanded_types.select { @subgraph_types_by_name_and_location[_1.graphql_name].length > 1 }.each do |impl_type| + expanded_types.select { subgraph_types_by_name_and_location.fetch(_1.graphql_name).length > 1 }.each do |impl_type| @resolver_map[impl_type.graphql_name] ||= [] - @resolver_map[impl_type.graphql_name].push(resolver) + @resolver_map.fetch(impl_type.graphql_name).push(resolver) end end end end - # @!scope class - # @!visibility private + #: (singleton(GraphQL::Schema) schema, untyped parent_type) -> Array[CompositeType] + def expand_abstract_type(schema, parent_type) + return EMPTY_ARRAY unless parent_type.kind.abstract? + return parent_type.possible_types if parent_type.kind.union? + + child_interfaces_by_parent = Hash.new { |hash, key| hash[key] = [] } + schema.types.each_value do |schema_type| + type = schema_type #: untyped + next unless type <= GraphQL::Schema::Interface && type != parent_type + + type.public_send(:interfaces).each do |interface_type| + child_interfaces_by_parent[interface_type] << type + end + end + + result = schema.possible_types(parent_type) + pending = child_interfaces_by_parent[parent_type].dup + + until pending.empty? + type = pending.shift + next if result.include?(type) + + result << type + pending.concat(child_interfaces_by_parent[type]) + end + + result + end + + #: (Array[singleton(GraphQL::Schema)] schemas) -> Hash[TypeName, Array[Symbol]] def build_enum_usage_map(schemas) reads = [] writes = [] @@ -707,6 +781,7 @@ def build_enum_usage_map(schemas) end end + #: (singleton(GraphQL::Schema) schema, TypeResolverMap resolvers_by_type_name, LocationsByTypeAndField locations_by_type_and_field) -> void def apply_supergraph_directives(schema, resolvers_by_type_name, locations_by_type_and_field) schema_directives = {} schema.types.each do |type_name, type| @@ -714,8 +789,11 @@ def apply_supergraph_directives(schema, resolvers_by_type_name, locations_by_typ # Apply key directives for each unique type/key/location # (this allows keys to be composite selections and/or omitted from the supergraph schema) keys_for_type = resolvers_for_type.each_with_object({}) do |resolver, memo| - memo[resolver.key.to_definition] ||= Set.new - memo[resolver.key.to_definition].merge(resolver.key.locations) + resolver_key = resolver.key + raise CompositionError, "Missing key for resolver on `#{type_name}`." unless resolver_key + + memo[resolver_key.to_definition] ||= Set.new + memo[resolver_key.to_definition].merge(resolver_key.locations) end keys_for_type.each do |key, locations| @@ -727,11 +805,14 @@ def apply_supergraph_directives(schema, resolvers_by_type_name, locations_by_typ # Apply resolver directives for each unique query resolver resolvers_for_type.each do |resolver| + resolver_key = resolver.key + raise CompositionError, "Missing key for resolver on `#{type_name}`." unless resolver_key + params = { location: resolver.location, field: resolver.field, list: resolver.list? || nil, - key: resolver.key.to_definition, + key: resolver_key.to_definition, arguments: resolver.arguments.map(&:to_definition).join(", "), argument_types: resolver.arguments.map(&:to_type_definition).join(", "), type_name: (resolver.type_name if resolver.type_name != type_name), diff --git a/lib/graphql/stitching/composer/base_validator.rb b/lib/graphql/stitching/composer/base_validator.rb index f47cea78..e2985ec6 100644 --- a/lib/graphql/stitching/composer/base_validator.rb +++ b/lib/graphql/stitching/composer/base_validator.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Composer class BaseValidator - def perform(ctx, composer) + #: (Supergraph supergraph, Composer composer) -> void + def perform(supergraph, composer) raise "not implemented" end end diff --git a/lib/graphql/stitching/composer/type_resolver_config.rb b/lib/graphql/stitching/composer/type_resolver_config.rb index a36062ea..cdb5def5 100644 --- a/lib/graphql/stitching/composer/type_resolver_config.rb +++ b/lib/graphql/stitching/composer/type_resolver_config.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Composer class TypeResolverConfig - ENTITY_TYPENAME = "_Entity" - ENTITIES_QUERY = "_entities" + ENTITY_TYPENAME = "_Entity".freeze #: TypeName + ENTITIES_QUERY = "_entities".freeze #: FieldName class << self + #: (singleton(GraphQL::Schema) schema, Location location, untyped assignments) -> Hash[String, Array[TypeResolverConfig]] def extract_directive_assignments(schema, location, assignments) return EMPTY_OBJECT unless assignments && !assignments.empty? @@ -23,6 +25,7 @@ def extract_directive_assignments(schema, location, assignments) end end + #: (singleton(GraphQL::Schema) schema, Location location) -> Hash[String, Array[TypeResolverConfig]] def extract_federation_entities(schema, location) return EMPTY_OBJECT unless federation_entities_schema?(schema) @@ -44,6 +47,7 @@ def extract_federation_entities(schema, location) end end + #: (Hash[Symbol, untyped] kwargs) -> TypeResolverConfig def from_kwargs(kwargs) new( key: kwargs[:key], @@ -54,6 +58,7 @@ def from_kwargs(kwargs) private + #: (singleton(GraphQL::Schema) schema) -> bool def federation_entities_schema?(schema) entity_type = schema.get_type(ENTITY_TYPENAME) entities_query = schema.query.get_field(ENTITIES_QUERY) @@ -66,12 +71,20 @@ def federation_entities_schema?(schema) end end - attr_reader :key, :type_name, :arguments + #: String + attr_reader :key + #: TypeName? + attr_reader :type_name + + #: String? + attr_reader :arguments + + #: (key: String, type_name: TypeName?, ?arguments: String?) -> void def initialize(key:, type_name:, arguments: nil) - @key = key - @type_name = type_name - @arguments = arguments + @key = key #: String + @type_name = type_name #: TypeName? + @arguments = arguments #: String? end end end diff --git a/lib/graphql/stitching/composer/validate_interfaces.rb b/lib/graphql/stitching/composer/validate_interfaces.rb index 1ff28df4..396b30c7 100644 --- a/lib/graphql/stitching/composer/validate_interfaces.rb +++ b/lib/graphql/stitching/composer/validate_interfaces.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Composer @@ -6,6 +7,7 @@ class ValidateInterfaces < BaseValidator # For each composed interface, check the interface against each possible type # to assure that intersecting fields have compatible types, structures, and nullability. # Verifies compatibility of types that inherit interface contracts through merging. + #: (Supergraph supergraph, Composer composer) -> void def perform(supergraph, composer) supergraph.schema.types.each do |type_name, interface_type| next unless interface_type.kind.interface? @@ -14,12 +16,12 @@ def perform(supergraph, composer) interface_type.fields.each do |field_name, interface_field| # graphql-ruby will dynamically apply interface fields on a type implementation, # so check the delegation map to assure that all materialized fields have resolver locations. - unless supergraph.locations_by_type_and_field[possible_type.graphql_name][field_name]&.any? + unless supergraph.locations_by_type_and_field.fetch(possible_type.graphql_name).fetch(field_name, EMPTY_ARRAY).any? raise ValidationError, "Type #{possible_type.graphql_name} does not implement a `#{field_name}` field in any location, "\ "which is required by interface #{interface_type.graphql_name}." end - intersecting_field = possible_type.fields[field_name] + intersecting_field = possible_type.fields.fetch(field_name) interface_type_structure = Util.flatten_type_structure(interface_field.type) possible_type_structure = Util.flatten_type_structure(intersecting_field.type) @@ -29,7 +31,7 @@ def perform(supergraph, composer) end interface_type_structure.each_with_index do |interface_struct, index| - possible_struct = possible_type_structure[index] + possible_struct = possible_type_structure.fetch(index) if possible_struct.name != interface_struct.name raise ValidationError, "Incompatible named types between field #{possible_type.graphql_name}.#{field_name} of type "\ @@ -45,7 +47,6 @@ def perform(supergraph, composer) end end end - end end end diff --git a/lib/graphql/stitching/composer/validate_type_resolvers.rb b/lib/graphql/stitching/composer/validate_type_resolvers.rb index 49bfd4bc..fd385e77 100644 --- a/lib/graphql/stitching/composer/validate_type_resolvers.rb +++ b/lib/graphql/stitching/composer/validate_type_resolvers.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Composer class ValidateTypeResolvers < BaseValidator - + #: (Supergraph supergraph, Composer composer) -> void def perform(supergraph, composer) root_types = [ supergraph.schema.query, @@ -18,7 +19,10 @@ def perform(supergraph, composer) next if type.graphql_name.start_with?("__") # multiple subschemas implement the type - subgraph_types_by_location = composer.subgraph_types_by_name_and_location[type_name] + subgraph_types_by_name_and_location = composer.subgraph_types_by_name_and_location + raise CompositionError, "Composer has no subgraph types." unless subgraph_types_by_name_and_location + + subgraph_types_by_location = subgraph_types_by_name_and_location.fetch(type_name) next unless subgraph_types_by_location.length > 1 resolvers = supergraph.resolvers[type_name] @@ -32,26 +36,30 @@ def perform(supergraph, composer) private + #: (Supergraph supergraph, singleton(GraphQL::Schema::Object) type, Hash[Location, untyped] subgraph_types_by_location, Array[TypeResolver] resolvers) -> void def validate_as_resolver(supergraph, type, subgraph_types_by_location, resolvers) # abstract resolvers are expanded with their concrete implementations, which each get validated. Ignore the abstract itself. return if type.kind.abstract? # only one resolver allowed per type/location/key resolvers_by_location_and_key = resolvers.each_with_object({}) do |resolver, memo| - if memo.dig(resolver.location, resolver.key.to_definition) - raise ValidationError, "Multiple resolver queries for `#{type.graphql_name}.#{resolver.key}` "\ + key = resolver.key + next unless key + + if memo.dig(resolver.location, key.to_definition) + raise ValidationError, "Multiple resolver queries for `#{type.graphql_name}.#{key}` "\ "found in #{resolver.location}. Limit one resolver query per type and key in each location. "\ "Abstract resolvers provide all possible types." end memo[resolver.location] ||= {} - memo[resolver.location][resolver.key.to_definition] = resolver + memo.fetch(resolver.location)[key.to_definition] = resolver end - resolver_keys = resolvers.map(&:key) + resolver_keys = resolvers.filter_map(&:key) resolver_key_strs = resolver_keys.map(&:to_definition).to_set # All non-key fields must be resolvable in at least one resolver location - supergraph.locations_by_type_and_field[type.graphql_name].each do |field_name, locations| + supergraph.locations_by_type_and_field.fetch(type.graphql_name).each do |field_name, locations| next if resolver_key_strs.include?(field_name) if locations.none? { resolvers_by_location_and_key[_1] } @@ -61,7 +69,7 @@ def validate_as_resolver(supergraph, type, subgraph_types_by_location, resolvers end # All locations of a merged type must include at least one resolver key - supergraph.fields_by_type_and_location[type.graphql_name].each do |location, field_names| + supergraph.fields_by_type_and_location.fetch(type.graphql_name).each do |location, field_names| has_resolver_key = resolver_keys.any? { _1.locations.include?(location) } has_primitive_match = resolver_keys.any? { field_names.include?(_1.primitive_name) } unless has_resolver_key || has_primitive_match @@ -81,6 +89,7 @@ def validate_as_resolver(supergraph, type, subgraph_types_by_location, resolvers end end + #: (Supergraph supergraph, singleton(GraphQL::Schema::Object) type, Hash[Location, untyped] subgraph_types_by_location) -> void def validate_as_shared(supergraph, type, subgraph_types_by_location) expected_fields = begin type.fields.keys.sort diff --git a/lib/graphql/stitching/executor.rb b/lib/graphql/stitching/executor.rb index aaddf9ac..9b13dd7f 100644 --- a/lib/graphql/stitching/executor.rb +++ b/lib/graphql/stitching/executor.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require "json" require_relative "executor/path_access" @@ -8,41 +9,36 @@ module GraphQL module Stitching - # Executor handles executing upon a planned request. - # All planned steps are initiated, their results merged, - # and loaded keys are collected for batching subsequent steps. - # Final execution results are then shaped to match the request selection. class Executor - # @return [Request] the stitching request to execute. + #: Request attr_reader :request - # @return [Hash] an aggregate data payload to return. + #: Data attr_reader :data - # @return [Array] aggregate GraphQL errors to return. + #: Array[GraphQLError] attr_reader :errors - # @return [Integer] tally of queries performed while executing. + #: Integer attr_accessor :query_count - # Builds a new executor. - # @param request [Request] the stitching request to execute. - # @param nonblocking [Boolean] specifies if the dataloader should use async concurrency. + #: (Request request, ?data: Data, ?errors: Array[GraphQLError], ?after: Integer, ?nonblocking: bool) -> void def initialize(request, data: {}, errors: [], after: Planner::ROOT_INDEX, nonblocking: false) @request = request @data = data @errors = errors - @after = after + @after = after #: Integer @query_count = 0 - @exec_cycles = 0 - @dataloader = GraphQL::Dataloader.new(nonblocking: nonblocking) + @exec_cycles = 0 #: Integer + @dataloader = GraphQL::Dataloader.new(nonblocking: nonblocking) #: GraphQL::Dataloader end + #: (?raw: bool) -> GraphQL::Query::Result def perform(raw: false) exec!([@after]) result = {} - if @data && @data.length > 0 + if @data.length > 0 result["data"] = raw ? @data : Shaper.new(@request).perform!(@data) end @@ -55,6 +51,7 @@ def perform(raw: false) private + #: (Array[Integer] next_steps) -> void def exec!(next_steps) if @exec_cycles > @request.plan.ops.length # sanity check... if we've exceeded queue size, then something went wrong. @@ -62,7 +59,7 @@ def exec!(next_steps) end @dataloader.append_job do - tasks = @request.plan + requests = @request.plan .ops .select { next_steps.include?(_1.after) } .group_by { [_1.location, _1.resolver.nil?] } @@ -71,15 +68,16 @@ def exec!(next_steps) @dataloader.with(source_class, self, location).request_all(ops) end - tasks.each(&method(:exec_task)) + requests.each(&method(:exec_request)) end @exec_cycles += 1 @dataloader.run end - def exec_task(task) - next_steps = task.load.tap(&:compact!) + #: (GraphQL::Dataloader::RequestAll request) -> void + def exec_request(request) + next_steps = request.load.tap(&:compact!) exec!(next_steps) unless next_steps.empty? end end diff --git a/lib/graphql/stitching/executor/path_access.rb b/lib/graphql/stitching/executor/path_access.rb index a40e117c..83fab5e6 100644 --- a/lib/graphql/stitching/executor/path_access.rb +++ b/lib/graphql/stitching/executor/path_access.rb @@ -1,19 +1,20 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Executor - # Utilities for traversing aggregate executor data along planned paths. module PathAccess private + #: (untyped root, Array[String] path) -> OriginSet def path_objects(root, path) objects = [] each_path_object(root, path) { |object| objects << object } objects end + #: (untyped scope, Array[String] path) { (Data) -> void } -> void def each_path_object(scope, path, &block) - return enum_for(:each_path_object, scope, path) unless block return if scope.nil? if path.empty? @@ -21,11 +22,12 @@ def each_path_object(scope, path, &block) elsif scope.is_a?(Array) scope.each { |element| each_path_object(element, path, &block) } elsif scope.respond_to?(:[]) - path_segment = path.first - each_path_object(scope[path_segment], path[1..-1], &block) + path_segment = path.fetch(0) + each_path_object(scope[path_segment], path.drop(1), &block) end end + #: (untyped scope) { (Data) -> void } -> void def each_leaf_object(scope, &block) return if scope.nil? @@ -36,14 +38,15 @@ def each_leaf_object(scope, &block) end end + #: (untyped root, Array[String] path) -> Array[OriginEntry] def path_entries(root, path) entries = [] each_path_entry(root, path) { |object, response_path| entries << [object, response_path] } entries end + #: (untyped scope, Array[String] path, ?ResponsePath response_path) { (Data, ResponsePath) -> void } -> void def each_path_entry(scope, path, response_path = [], &block) - return enum_for(:each_path_entry, scope, path, response_path) unless block return if scope.nil? if path.empty? @@ -53,11 +56,12 @@ def each_path_entry(scope, path, response_path = [], &block) each_path_entry(element, path, [*response_path, index], &block) end elsif scope.respond_to?(:[]) - path_segment = path.first - each_path_entry(scope[path_segment], path[1..-1], [*response_path, path_segment], &block) + path_segment = path.fetch(0) + each_path_entry(scope[path_segment], path.drop(1), [*response_path, path_segment], &block) end end + #: (untyped scope, ResponsePath response_path) { (Data, ResponsePath) -> void } -> void def each_leaf_entry(scope, response_path, &block) return if scope.nil? @@ -70,6 +74,7 @@ def each_leaf_entry(scope, response_path, &block) end end + #: (GraphQLError error, ?path: ResponsePath?) -> GraphQLError def sanitized_error(error, path: nil) error.dup.tap do |formatted| formatted.delete("locations") diff --git a/lib/graphql/stitching/executor/root_source.rb b/lib/graphql/stitching/executor/root_source.rb index 53a6e4ee..274aabaf 100644 --- a/lib/graphql/stitching/executor/root_source.rb +++ b/lib/graphql/stitching/executor/root_source.rb @@ -1,15 +1,18 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Executor class RootSource < GraphQL::Dataloader::Source include PathAccess + #: (Executor executor, Location location) -> void def initialize(executor, location) - @executor = executor - @location = location + @executor = executor #: Executor + @location = location #: Location end + #: (Array[Plan::Op] ops) -> Array[Integer] def fetch(ops) ops.map do |op| origin_set = op.path.empty? ? [@executor.data] : path_objects(@executor.data, op.path) @@ -19,12 +22,12 @@ def fetch(ops) @executor.request.operation_name, @executor.request.operation_directives, ) - query_variables = @executor.request.variables.slice(*op.variables.each_key) + query_variables = @executor.request.variables.select { |key, _value| op.variables.key?(key) } result = @executor.request.supergraph.execute_at_location(op.location, query_document, query_variables, @executor.request) @executor.query_count += 1 errors = result["errors"] - origin_entries = nil + origin_entries = [] #: Array[OriginEntry] if errors && !errors.empty? origin_entries = op.path.empty? ? [[@executor.data, []]] : path_entries(@executor.data, op.path) @@ -48,8 +51,7 @@ def fetch(ops) end end - # Builds root source documents - # "query MyOperation_1($var:VarType) { rootSelections ... }" + #: (Plan::Op op, ?String? operation_name, ?String? operation_directives) -> String def build_document(op, operation_name = nil, operation_directives = nil) doc_buffer = String.new doc_buffer << op.operation_type @@ -75,8 +77,7 @@ def build_document(op, operation_name = nil, operation_directives = nil) doc_buffer end - # Format response errors without a document location (because it won't match the request doc), - # and prepend all concrete insertion paths for nested scopes into error paths. + #: (Array[GraphQLError] errors, Array[OriginEntry] origin_entries, ?ResponsePath fallback_path) -> Array[GraphQLError] def format_errors(errors, origin_entries, fallback_path = []) errors.flat_map do |err| path = err["path"] diff --git a/lib/graphql/stitching/executor/shaper.rb b/lib/graphql/stitching/executor/shaper.rb index e3e80052..7927e7fe 100644 --- a/lib/graphql/stitching/executor/shaper.rb +++ b/lib/graphql/stitching/executor/shaper.rb @@ -1,19 +1,18 @@ -# typed: false # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Executor - # Shapes the final results payload to the request selection and schema definition. - # This eliminates unrequested export selections and applies null bubbling. - # @api private class Shaper + #: (Request request) -> void def initialize(request) - @request = request - @supergraph = request.supergraph - @root_type = nil - @possible_type_names_by_type = nil + @request = request #: Request + @supergraph = request.supergraph #: Supergraph + @root_type = nil #: CompositeType? + @possible_type_names_by_type = nil #: Hash[TypeName, Array[TypeName]]? end + #: (Data raw) -> Data? def perform!(raw) @root_type = @request.query.root_type_for_operation(@request.operation.operation_type) resolve_object_scope(raw, @root_type, @request.operation.selections, @root_type.graphql_name) @@ -21,6 +20,7 @@ def perform!(raw) private + #: (Data? raw_object, CompositeType parent_type, Array[SelectionNode] selections, ?TypeName? typename) -> Data? def resolve_object_scope(raw_object, parent_type, selections, typename = nil) return nil if raw_object.nil? @@ -46,7 +46,7 @@ def resolve_object_scope(raw_object, parent_type, selections, typename = nil) next end - node_type = @supergraph.memoized_schema_fields(parent_type.graphql_name)[node.name].type + node_type = @supergraph.memoized_schema_fields(parent_type.graphql_name).fetch(node.name).type named_type = node_type.unwrap raw_object[field_name] = if node_type.list? @@ -60,15 +60,15 @@ def resolve_object_scope(raw_object, parent_type, selections, typename = nil) return nil if node_type.non_null? && raw_object[field_name].nil? when GraphQL::Language::Nodes::InlineFragment - fragment_type = node.type ? @supergraph.memoized_schema_types[node.type.name] : parent_type + fragment_type = node.type ? @supergraph.memoized_schema_types.fetch(node.type.name) : parent_type next unless typename_in_type?(typename, fragment_type) result = resolve_object_scope(raw_object, fragment_type, node.selections, typename) return nil if result.nil? when GraphQL::Language::Nodes::FragmentSpread - fragment = @request.fragment_definitions[node.name] - fragment_type = @supergraph.memoized_schema_types[fragment.type.name] + fragment = @request.fragment_definitions.fetch(node.name) + fragment_type = @supergraph.memoized_schema_types.fetch(fragment.type.name) next unless typename_in_type?(typename, fragment_type) result = resolve_object_scope(raw_object, fragment_type, fragment.selections, typename) @@ -82,6 +82,7 @@ def resolve_object_scope(raw_object, parent_type, selections, typename = nil) raw_object end + #: (Array[untyped]? raw_list, GraphQL::Schema::Wrapper current_node_type, Array[SelectionNode] selections) -> untyped def resolve_list_scope(raw_list, current_node_type, selections) return nil if raw_list.nil? @@ -109,6 +110,7 @@ def resolve_list_scope(raw_list, current_node_type, selections) resolved_list end + #: (TypeName? typename, CompositeType type) -> bool def typename_in_type?(typename, type) return true if type.graphql_name == typename return false unless typename && type.kind.abstract? @@ -116,6 +118,7 @@ def typename_in_type?(typename, type) possible_type_names(type).include?(typename) end + #: (CompositeType type) -> Array[TypeName] def possible_type_names(type) (@possible_type_names_by_type ||= {})[type.graphql_name] ||= @request.query.possible_types(type).map(&:graphql_name) end diff --git a/lib/graphql/stitching/executor/type_resolver_source.rb b/lib/graphql/stitching/executor/type_resolver_source.rb index 7bd50604..efbc346b 100644 --- a/lib/graphql/stitching/executor/type_resolver_source.rb +++ b/lib/graphql/stitching/executor/type_resolver_source.rb @@ -1,15 +1,18 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Executor class TypeResolverSource < GraphQL::Dataloader::Source include PathAccess + #: (Executor executor, Location location) -> void def initialize(executor, location) - @executor = executor - @location = location + @executor = executor #: Executor + @location = location #: Location end + #: (Array[Plan::Op] ops) -> Array[Integer?] def fetch(ops) origin_sets_by_operation = ops.each_with_object({}.compare_by_identity) do |op, memo| origin_set = path_objects(@executor.data, op.path) @@ -28,7 +31,7 @@ def fetch(ops) @executor.request.operation_name, @executor.request.operation_directives, ) - variables = generated_variables.merge(@executor.request.variables.slice(*variable_names)) + variables = generated_variables.merge(@executor.request.variables.select { |key, _value| variable_names.include?(key) }) raw_result = @executor.request.supergraph.execute_at_location(@location, query_document, variables, @executor.request) @executor.query_count += 1 @@ -41,13 +44,7 @@ def fetch(ops) ops.map { origin_sets_by_operation[_1] ? _1.step : nil } end - # Builds batched resolver queries - # "query MyOperation_2_3($var:VarType, $_0_key:[ID!]!, $_1_0_key:ID!, $_1_1_key:ID!, $_1_2_key:ID!) { - # _0_result: list(keys: $_0_key) { resolverSelections... } - # _1_0_result: item(key: $_1_0_key) { resolverSelections... } - # _1_1_result: item(key: $_1_1_key) { resolverSelections... } - # _1_2_result: item(key: $_1_2_key) { resolverSelections... } - # }" + #: (OriginSetsByOperation origin_sets_by_operation, ?String? operation_name, ?String? operation_directives) -> [String, Array[String], Variables] def build_document(origin_sets_by_operation, operation_name = nil, operation_directives = nil) variable_defs = {} generated_variables = {} @@ -55,7 +52,7 @@ def build_document(origin_sets_by_operation, operation_name = nil, operation_dir origin_sets_by_operation.each_with_index do |(op, origin_set), batch_index| variable_defs.merge!(op.variables) - resolver = @executor.request.supergraph.resolvers_by_version[op.resolver] + resolver = resolver_for_op(op) fields_buffer << " " unless batch_index.zero? if resolver.list? @@ -127,11 +124,12 @@ def build_document(origin_sets_by_operation, operation_name = nil, operation_dir return doc_buffer, variable_names, generated_variables end + #: (OriginSetsByOperation origin_sets_by_operation, Data? raw_result) -> void def merge_results!(origin_sets_by_operation, raw_result) return unless raw_result origin_sets_by_operation.each_with_index do |(op, origin_set), batch_index| - results = if @executor.request.supergraph.resolvers_by_version[op.resolver].list? + results = if resolver_for_op(op).list? raw_result["_#{batch_index}_result"] else origin_set.map.with_index { |_, index| raw_result["_#{batch_index}_#{index}_result"] } @@ -146,7 +144,7 @@ def merge_results!(origin_sets_by_operation, raw_result) end end - # https://spec.graphql.org/June2018/#sec-Errors + #: (OriginSetsByOperation origin_sets_by_operation, Array[GraphQLError] errors, ?OriginPathsByOperation? origin_paths_by_operation) -> Array[GraphQLError] def extract_errors!(origin_sets_by_operation, errors, origin_paths_by_operation = nil) ops = origin_sets_by_operation.keys origin_sets = origin_sets_by_operation.values @@ -161,7 +159,7 @@ def extract_errors!(origin_sets_by_operation, errors, origin_paths_by_operation result_alias = /^_(\d+)(?:_(\d+))?_result$/.match(path.first.to_s) if result_alias - path = path[1..-1] + path = path.drop(1) batch_index = result_alias[1].to_i origin_index = if result_alias[2] @@ -172,7 +170,7 @@ def extract_errors!(origin_sets_by_operation, errors, origin_paths_by_operation origin_obj = origin_sets.dig(batch_index, origin_index) if origin_index if origin_obj - op = ops[batch_index] + op = ops.fetch(batch_index) object_path = origin_paths_by_operation.dig(op, origin_index) if object_path @@ -192,6 +190,15 @@ def extract_errors!(origin_sets_by_operation, errors, origin_paths_by_operation private + #: (Plan::Op op) -> TypeResolver + def resolver_for_op(op) + resolver_version = op.resolver + raise StitchingError, "Missing resolver for planned operation #{op.step}." unless resolver_version + + @executor.request.supergraph.resolvers_by_version.fetch(resolver_version) + end + + #: (Plan::Op op, OriginSet origin_set) -> Array[ResponsePath?] def paths_for_origin_set(op, origin_set) paths_by_object_id = path_entries(@executor.data, op.path).each_with_object(Hash.new { |h, k| h[k] = [] }) do |(object, path), memo| memo[object.object_id] << path diff --git a/lib/graphql/stitching/http_executable.rb b/lib/graphql/stitching/http_executable.rb index f6cc71af..73974451 100644 --- a/lib/graphql/stitching/http_executable.rb +++ b/lib/graphql/stitching/http_executable.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require "net/http" require "uri" @@ -6,20 +7,15 @@ module GraphQL module Stitching - # HttpExecutable provides an out-of-the-box convenience for sending - # HTTP post requests to a remote location, or a base class - # for other implementations with GraphQL multipart uploads. class HttpExecutable - # Builds a new executable for proxying subgraph requests via HTTP. - # @param url [String] the url of the remote location to proxy. - # @param headers [Hash] headers to include in upstream requests. - # @param upload_types [Array, nil] a list of scalar names that represent file uploads. These types extract into multipart forms. + #: (url: String, ?headers: Hash[String, String], ?upload_types: Array[TypeName]?) -> void def initialize(url:, headers: {}, upload_types: nil) - @url = url - @headers = { "Content-Type" => "application/json" }.merge!(headers) - @upload_types = upload_types + @url = url #: String + @headers = { "Content-Type" => "application/json" }.merge!(headers) #: Hash[String, String] + @upload_types = upload_types #: Array[TypeName]? end + #: (Request request, String document, Variables variables) -> JsonMap def call(request, document, variables) form_data = extract_multipart_form(request, document, variables) @@ -29,13 +25,10 @@ def call(request, document, variables) send(request, document, variables) end - JSON.parse(response.body) + JSON.parse(response.body.to_s) end - # Sends a POST request to the remote location. - # @param request [Request] the original supergraph request. - # @param document [String] the location-specific subgraph document to send. - # @param variables [Hash] a hash of variables specific to the subgraph document. + #: (Request _request, String document, Variables variables) -> Net::HTTPResponse def send(_request, document, variables) Net::HTTP.post( URI(@url), @@ -44,9 +37,7 @@ def send(_request, document, variables) ) end - # Sends a POST request to the remote location with multipart form data. - # @param request [Request] the original supergraph request. - # @param form_data [Hash] a rendered multipart form with an "operations", "map", and file sections. + #: (Request _request, MultipartForm form_data) -> Net::HTTPResponse def send_multipart_form(_request, form_data) uri = URI(@url) req = Net::HTTP::Post.new(uri) @@ -62,11 +53,10 @@ def send_multipart_form(_request, form_data) # Extracts multipart upload forms per the spec: # https://github.com/jaydenseric/graphql-multipart-request-spec - # @param request [Request] the original supergraph request. - # @param document [String] the location-specific subgraph document to send. - # @param variables [Hash] a hash of variables specific to the subgraph document. + #: (Request request, String document, Variables variables) -> MultipartForm? def extract_multipart_form(request, document, variables) - return unless @upload_types && request.variable_definitions.any? && variables&.any? + upload_types = @upload_types + return unless upload_types && request.variable_definitions.any? && variables.any? files_by_path = {} @@ -85,8 +75,8 @@ def extract_multipart_form(request, document, variables) variables_copy = variables.dup files_by_path.each_key do |path| - orig = variables - copy = variables_copy + orig = variables #: untyped + copy = variables_copy #: untyped path.each_with_index do |key, i| if i == path.length - 1 file_index = files.index(copy[key]).to_s @@ -115,9 +105,14 @@ def extract_multipart_form(request, document, variables) private + #: (untyped ast_node, untyped value, FilesByPath files_by_path, VariablePath path, Request request) -> void def extract_ast_node(ast_node, value, files_by_path, path, request) return unless value + upload_types = @upload_types + return unless upload_types + + ast_node = ast_node #: untyped ast_node = ast_node.of_type while ast_node.is_a?(GraphQL::Language::Nodes::NonNullType) if ast_node.is_a?(GraphQL::Language::Nodes::ListType) @@ -128,7 +123,7 @@ def extract_ast_node(ast_node, value, files_by_path, path, request) path.pop end end - elsif @upload_types.include?(ast_node.name) + elsif upload_types.include?(ast_node.name) files_by_path[path.dup] = value else type_def = request.query.get_type(ast_node.name) @@ -136,9 +131,13 @@ def extract_ast_node(ast_node, value, files_by_path, path, request) end end + #: (untyped parent_type, untyped value, FilesByPath files_by_path, VariablePath path) -> void def extract_type_node(parent_type, value, files_by_path, path) return unless value + upload_types = @upload_types + return unless upload_types + parent_type = Util.unwrap_non_null(parent_type) if parent_type.list? @@ -159,7 +158,7 @@ def extract_type_node(parent_type, value, files_by_path, path) path.pop end end - elsif @upload_types.include?(parent_type.graphql_name) + elsif upload_types.include?(parent_type.graphql_name) files_by_path[path.dup] = value end end diff --git a/lib/graphql/stitching/plan.rb b/lib/graphql/stitching/plan.rb index 9e07adf2..0e6a347c 100644 --- a/lib/graphql/stitching/plan.rb +++ b/lib/graphql/stitching/plan.rb @@ -1,21 +1,48 @@ # frozen_string_literal: true +# typed: true module GraphQL module Stitching - # Immutable structures representing a query plan. - # May serialize to/from JSON. class Plan class Op + #: Integer attr_reader :step + + #: Integer? attr_reader :after + + #: Location attr_reader :location + + #: String attr_reader :operation_type + + #: String attr_reader :selections + + #: RenderedVariables attr_reader :variables + + #: Array[String] attr_reader :path + + #: TypeName? attr_reader :if_type + + #: String? attr_reader :resolver - + + #: ( + #| step: Integer, + #| after: Integer?, + #| location: Location, + #| operation_type: String, + #| selections: String, + #| ?variables: RenderedVariables?, + #| ?path: Array[String]?, + #| ?if_type: TypeName?, + #| ?resolver: String? + #| ) -> void def initialize( step:, after:, @@ -32,12 +59,13 @@ def initialize( @location = location @operation_type = operation_type @selections = selections - @variables = variables - @path = path + @variables = variables || {} + @path = path || [] @if_type = if_type @resolver = resolver end + #: -> JsonMap def as_json { step: step, @@ -52,6 +80,7 @@ def as_json }.tap(&:compact!) end + #: (untyped other) -> bool def ==(other) step == other.step && after == other.after && @@ -66,6 +95,7 @@ def ==(other) end class << self + #: (JsonMap json) -> Plan def from_json(json) ops = json["ops"] ops = ops.map do |op| @@ -85,15 +115,18 @@ def from_json(json) end end + #: Array[Op] attr_reader :ops + #: (?ops: Array[Op]) -> void def initialize(ops: []) @ops = ops end + #: -> JsonMap def as_json { ops: @ops.map(&:as_json) } end end end -end \ No newline at end of file +end diff --git a/lib/graphql/stitching/planner.rb b/lib/graphql/stitching/planner.rb index a6c05b21..cc31c750 100644 --- a/lib/graphql/stitching/planner.rb +++ b/lib/graphql/stitching/planner.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require_relative "planner/step" @@ -11,27 +12,35 @@ class Planner ROOT_INDEX = 0 class ScopePartition - attr_reader :location, :selections + #: Location + attr_reader :location + #: Array[SelectionNode] + attr_reader :selections + + #: (location: Location, selections: Array[SelectionNode]) -> void def initialize(location:, selections:) - @location = location - @selections = selections + @location = location #: Location + @selections = selections #: Array[SelectionNode] end end + #: (Request request) -> void def initialize(request) - @request = request - @supergraph = request.supergraph - @planning_index = ROOT_INDEX - @steps_by_entrypoint = {} + @request = request #: Request + @supergraph = request.supergraph #: Supergraph + @planning_index = ROOT_INDEX #: Integer + @steps_by_entrypoint = {} #: Hash[String, Step] end + #: -> Plan def perform build_root_entrypoints expand_abstract_resolvers Plan.new(ops: steps.map!(&:to_plan_op)) end + #: -> Array[Step] def steps @steps_by_entrypoint.values.sort_by!(&:index) end @@ -117,6 +126,7 @@ def add_step( end # A) Group all root selections by their preferred entrypoint locations. + #: -> void def build_root_entrypoints parent_type = @request.query.root_type_for_operation(@request.operation.operation_type) @@ -125,7 +135,7 @@ def build_root_entrypoints # A.1) Group query fields by location for parallel execution. selections_by_location = Hash.new { |h, k| h[k] = [] } each_field_in_scope(parent_type, @request.operation.selections) do |node| - locations = @supergraph.locations_by_type_and_field[parent_type.graphql_name][node.name] || SUPERGRAPH_LOCATIONS + locations = locations_for_field(parent_type, node.name) selections_by_location[locations.first] << node end @@ -143,14 +153,14 @@ def build_root_entrypoints # A.2) Partition mutation fields by consecutive location for serial execution. partitions = [] each_field_in_scope(parent_type, @request.operation.selections) do |node| - locations = @supergraph.locations_by_type_and_field[parent_type.graphql_name][node.name] || SUPERGRAPH_LOCATIONS - next_location = locations.first + locations = locations_for_field(parent_type, node.name) + next_location = locations.fetch(0) - if partitions.none? || partitions.last.location != next_location + if partitions.none? || partitions.fetch(-1).location != next_location partitions << ScopePartition.new(location: next_location, selections: []) end - partitions.last.selections << node + partitions.fetch(-1).selections << node end partitions.reduce(ROOT_INDEX) do |parent_index, partition| @@ -168,7 +178,7 @@ def build_root_entrypoints each_field_in_scope(parent_type, @request.operation.selections) do |node| raise DocumentError.new("root field") unless @steps_by_entrypoint.empty? - locations = @supergraph.locations_by_type_and_field[parent_type.graphql_name][node.name] || SUPERGRAPH_LOCATIONS + locations = locations_for_field(parent_type, node.name) add_step( location: locations.first, parent_index: ROOT_INDEX, @@ -183,6 +193,7 @@ def build_root_entrypoints end end + #: (CompositeType parent_type, Array[SelectionNode] input_selections) { (GraphQL::Language::Nodes::Field) -> void } -> void def each_field_in_scope(parent_type, input_selections, &block) input_selections.each do |node| case node @@ -195,16 +206,25 @@ def each_field_in_scope(parent_type, input_selections, &block) when GraphQL::Language::Nodes::FragmentSpread fragment = @request.fragment_definitions[node.name] + raise DocumentError.new("fragment definition") unless fragment + next unless parent_type.graphql_name == fragment.type.name each_field_in_scope(parent_type, fragment.selections, &block) - else - raise DocumentError.new("selection node type") end end end # B) Contiguous selections are extracted for each entrypoint location. + #: ( + #| String current_location, + #| CompositeType parent_type, + #| Integer parent_index, + #| Array[SelectionNode] input_selections, + #| Array[String] path, + #| Variables locale_variables, + #| ?Array[SelectionNode] locale_selections + #| ) -> Array[SelectionNode] def extract_locale_selections( current_location, parent_type, @@ -219,7 +239,7 @@ def extract_locale_selections( # B.2) Filter the selection tree down to just fields of the entrypoint location. # Adjoining selections not available here get split off into new entrypoints (C). - remote_selections = nil + remote_selections = [] #: Array[GraphQL::Language::Nodes::Field] requires_typename = parent_type.kind.abstract? input_selections.each do |node| @@ -232,9 +252,8 @@ def extract_locale_selections( next end - possible_locations = @supergraph.locations_by_type_and_field[parent_type.graphql_name][node.name] || SUPERGRAPH_LOCATIONS + possible_locations = locations_for_field(parent_type, node.name) unless possible_locations.include?(current_location) - remote_selections ||= [] remote_selections << node next end @@ -243,7 +262,7 @@ def extract_locale_selections( extract_node_argument_variables(node, locale_variables) extract_node_directive_variables(node, locale_variables) schema_fields = @supergraph.memoized_schema_fields(parent_type.graphql_name) - field_type = schema_fields[node.name].type.unwrap + field_type = schema_fields.fetch(node.name).type.unwrap if Util.is_leaf_type?(field_type) locale_selections << node @@ -256,8 +275,8 @@ def extract_locale_selections( end when GraphQL::Language::Nodes::InlineFragment - fragment_type = node.type ? @supergraph.memoized_schema_types[node.type.name] : parent_type - next unless @supergraph.locations_by_type[fragment_type.graphql_name].include?(current_location) + fragment_type = node.type ? @supergraph.memoized_schema_types.fetch(node.type.name) : parent_type + next unless locations_for_type(fragment_type.graphql_name).include?(current_location) extract_node_directive_variables(node, locale_variables) is_same_scope = fragment_type == parent_type && node.directives.empty? @@ -271,12 +290,14 @@ def extract_locale_selections( when GraphQL::Language::Nodes::FragmentSpread fragment = @request.fragment_definitions[node.name] - next unless @supergraph.locations_by_type[fragment.type.name].include?(current_location) + raise DocumentError.new("fragment definition") unless fragment + + next unless locations_for_type(fragment.type.name).include?(current_location) extract_node_directive_variables(node, locale_variables) extract_node_directive_variables(fragment, locale_variables) requires_typename = true - fragment_type = @supergraph.memoized_schema_types[fragment.type.name] + fragment_type = @supergraph.memoized_schema_types.fetch(fragment.type.name) directives = fragment.directives.empty? && node.directives.empty? ? EMPTY_ARRAY : fragment.directives + node.directives is_same_scope = fragment_type == parent_type && directives.empty? selection_set = is_same_scope ? locale_selections : [] @@ -286,8 +307,6 @@ def extract_locale_selections( locale_selections << GraphQL::Language::Nodes::InlineFragment.new(type: fragment.type, directives: directives, selections: selection_set) end - else - raise DocumentError.new("selection node type") end end @@ -297,7 +316,7 @@ def extract_locale_selections( locale_selections << TypeResolver::TYPENAME_EXPORT_NODE end - if remote_selections + if remote_selections.any? # C) Delegate adjoining selections to new entrypoint locations. remote_selections_by_location = delegate_remote_selections(parent_type, remote_selections) @@ -308,7 +327,9 @@ def extract_locale_selections( routes.each_value do |route| route.reduce(locale_selections) do |parent_selections, resolver| # E.1) Add the key of each resolver query into the prior location's selection set. - parent_selections.push(*resolver.key.export_nodes) if resolver.key + if key = resolver.key + key.export_nodes.each { parent_selections << _1 } + end parent_selections.uniq! do |node| export_node = node.is_a?(GraphQL::Language::Nodes::Field) && TypeResolver.export_key?(node.alias) export_node ? node.alias : node.object_id @@ -332,15 +353,15 @@ def extract_locale_selections( # B.1) Selections on interface types that do not belong to the interface at the # entrypoint location are expanded into concrete type fragments prior to extraction. + #: (String current_location, CompositeType parent_type, Array[SelectionNode] input_selections) -> Array[SelectionNode] def expand_interface_selections(current_location, parent_type, input_selections) return input_selections unless parent_type.kind.interface? - local_interface_fields = @supergraph.fields_by_type_and_location[parent_type.graphql_name][current_location] + local_interface_fields = @supergraph.fields_by_type_and_location.fetch(parent_type.graphql_name).fetch(current_location) - expanded_selections = nil + expanded_selections = [] #: Array[SelectionNode] input_selections = input_selections.filter_map do |node| if node.is_a?(GraphQL::Language::Nodes::Field) && node.name != TYPENAME && !local_interface_fields.include?(node.name) - expanded_selections ||= [] expanded_selections << node nil else @@ -348,9 +369,9 @@ def expand_interface_selections(current_location, parent_type, input_selections) end end - if expanded_selections + if expanded_selections.any? @request.query.possible_types(parent_type).each do |possible_type| - next unless @supergraph.locations_by_type[possible_type.graphql_name].include?(current_location) + next unless locations_for_type(possible_type.graphql_name).include?(current_location) type_name = GraphQL::Language::Nodes::TypeName.new(name: possible_type.graphql_name) input_selections << GraphQL::Language::Nodes::InlineFragment.new(type: type_name, selections: expanded_selections) @@ -362,6 +383,7 @@ def expand_interface_selections(current_location, parent_type, input_selections) # B.3) Collect all variable definitions used within the filtered selection. # These specify which request variables to pass along with each step. + #: (ArgumentNode node, Variables variable_definitions) -> void def extract_node_argument_variables(node, variable_definitions) arguments = node.arguments return if arguments.empty? @@ -369,6 +391,7 @@ def extract_node_argument_variables(node, variable_definitions) arguments.each { |argument| extract_value_variables(argument.value, variable_definitions) } end + #: (SelectionNode node, Variables variable_definitions) -> void def extract_node_directive_variables(node, variable_definitions) directives = node.directives return if directives.empty? @@ -376,6 +399,7 @@ def extract_node_directive_variables(node, variable_definitions) directives.each { |directive| extract_node_argument_variables(directive, variable_definitions) } end + #: (untyped value, Variables variable_definitions) -> void def extract_value_variables(value, variable_definitions) case value when GraphQL::Language::Nodes::InputObject @@ -388,13 +412,14 @@ def extract_value_variables(value, variable_definitions) end # C) Delegate adjoining selections to new entrypoint locations. + #: (CompositeType parent_type, Array[GraphQL::Language::Nodes::Field] remote_selections) -> Hash[String, Array[GraphQL::Language::Nodes::Field]] def delegate_remote_selections(parent_type, remote_selections) - possible_locations_by_field = @supergraph.locations_by_type_and_field[parent_type.graphql_name] + possible_locations_by_field = @supergraph.locations_by_type_and_field.fetch(parent_type.graphql_name) selections_by_location = {} # C.1) Distribute unique fields among their required locations. remote_selections.reject! do |node| - possible_locations = possible_locations_by_field[node.name] + possible_locations = possible_locations_by_field.fetch(node.name) if possible_locations.length == 1 selections_by_location[possible_locations.first] ||= [] selections_by_location[possible_locations.first] << node @@ -407,7 +432,7 @@ def delegate_remote_selections(parent_type, remote_selections) available_locations = Set.new(selections_by_location.each_key) remote_selections.reject! do |node| - used_location = possible_locations_by_field[node.name].find { available_locations.include?(_1) } + used_location = possible_locations_by_field.fetch(node.name).find { available_locations.include?(_1) } if used_location selections_by_location[used_location] << node true @@ -419,13 +444,13 @@ def delegate_remote_selections(parent_type, remote_selections) if !remote_selections.empty? field_count_by_location = Hash.new(0) remote_selections.each do |node| - possible_locations_by_field[node.name].each do |location| + possible_locations_by_field.fetch(node.name).each do |location| field_count_by_location[location] += 1 end end remote_selections.each do |node| - possible_locations = possible_locations_by_field[node.name] + possible_locations = possible_locations_by_field.fetch(node.name) preferred_location = possible_locations.max_by { field_count_by_location[_1] } || possible_locations.first selections_by_location[preferred_location] ||= [] selections_by_location[preferred_location] << node @@ -436,29 +461,42 @@ def delegate_remote_selections(parent_type, remote_selections) end # F) Wrap concrete selections targeting abstract resolvers in typed fragments. + #: -> void def expand_abstract_resolvers @steps_by_entrypoint.each_value do |step| - next unless step.resolver + resolver = step.resolver + next unless resolver + resolver_type_name = resolver.type_name + next unless resolver_type_name - resolver_type = @supergraph.memoized_schema_types[step.resolver.type_name] + resolver_type = @supergraph.memoized_schema_types.fetch(resolver_type_name) next unless resolver_type.kind.abstract? next if resolver_type == step.parent_type - expanded_selections = nil + expanded_selections = [] #: Array[SelectionNode] step.selections.reject! do |node| if node.is_a?(GraphQL::Language::Nodes::Field) - expanded_selections ||= [] expanded_selections << node true end end - if expanded_selections + if expanded_selections.any? type_name = GraphQL::Language::Nodes::TypeName.new(name: step.parent_type.graphql_name) step.selections << GraphQL::Language::Nodes::InlineFragment.new(type: type_name, selections: expanded_selections) end end end + + #: (CompositeType parent_type, FieldName field_name) -> Array[Location] + def locations_for_field(parent_type, field_name) + @supergraph.locations_by_type_and_field.fetch(parent_type.graphql_name).fetch(field_name, SUPERGRAPH_LOCATIONS) + end + + #: (TypeName type_name) -> Array[Location] + def locations_for_type(type_name) + @supergraph.locations_by_type.fetch(type_name) + end end end end diff --git a/lib/graphql/stitching/planner/step.rb b/lib/graphql/stitching/planner/step.rb index b4939df7..1539121a 100644 --- a/lib/graphql/stitching/planner/step.rb +++ b/lib/graphql/stitching/planner/step.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Planner @@ -8,9 +9,44 @@ class Planner class Step GRAPHQL_PRINTER = GraphQL::Language::Printer.new - attr_reader :index, :location, :parent_type, :operation_type, :path - attr_accessor :after, :selections, :variables, :resolver + #: Integer + attr_reader :index + #: String + attr_reader :location + + #: CompositeType + attr_reader :parent_type + + #: String + attr_reader :operation_type + + #: Array[String] + attr_reader :path + + #: Integer? + attr_accessor :after + + #: Array[SelectionNode] + attr_accessor :selections + + #: Variables + attr_accessor :variables + + #: TypeResolver? + attr_accessor :resolver + + #: ( + #| location: String, + #| parent_type: CompositeType, + #| index: Integer, + #| ?after: Integer?, + #| ?operation_type: String, + #| ?selections: Array[SelectionNode], + #| ?variables: Variables, + #| ?path: Array[String], + #| ?resolver: TypeResolver? + #| ) -> void def initialize( location:, parent_type:, @@ -22,17 +58,18 @@ def initialize( path: [], resolver: nil ) - @location = location - @parent_type = parent_type - @index = index - @after = after - @operation_type = operation_type - @selections = selections - @variables = variables - @path = path - @resolver = resolver + @location = location #: Location + @parent_type = parent_type #: CompositeType + @index = index #: Integer + @after = after #: Integer? + @operation_type = operation_type #: String + @selections = selections #: Array[SelectionNode] + @variables = variables #: Variables + @path = path #: Array[String] + @resolver = resolver #: TypeResolver? end + #: -> Plan::Op def to_plan_op GraphQL::Stitching::Plan::Op.new( step: @index, @@ -52,15 +89,18 @@ def to_plan_op # Concrete types going to a resolver report themselves as a type condition. # This is used by the executor to evalute which planned fragment selections # actually apply to the resolved object types. + #: -> String? def type_condition @parent_type.graphql_name if @resolver && !parent_type.kind.abstract? end + #: -> String def rendered_selections op = GraphQL::Language::Nodes::OperationDefinition.new(operation_type: "", selections: @selections) GRAPHQL_PRINTER.print(op).gsub!(/\s+/, " ").strip! end + #: -> RenderedVariables def rendered_variables @variables.each_with_object({}) do |(variable_name, value_type), memo| memo[variable_name] = GRAPHQL_PRINTER.print(value_type) diff --git a/lib/graphql/stitching/request.rb b/lib/graphql/stitching/request.rb index 5ebc4db6..c298605b 100644 --- a/lib/graphql/stitching/request.rb +++ b/lib/graphql/stitching/request.rb @@ -1,31 +1,42 @@ # frozen_string_literal: true +# typed: true require_relative "request/skip_include" module GraphQL module Stitching - # Request combines a supergraph, GraphQL document, variables, - # variable/fragment definitions, and the selected operation. - # It provides the lifecycle of validating, preparing, - # planning, and executing upon these inputs. class Request - SKIP_INCLUDE_DIRECTIVE = /@(?:skip|include)/ + SKIP_INCLUDE_DIRECTIVE = /@(?:skip|include)/.freeze - # @return [Supergraph] supergraph instance that resolves the request. + #: Supergraph attr_reader :supergraph - # @return [GraphQL::Query] query object defining the request. + #: GraphQL::Query attr_reader :query - # @return [Hash] contextual object passed through resolver flows. + #: untyped attr_reader :context - # Creates a new supergraph request. - # @param supergraph [Supergraph] supergraph instance that resolves the request. - # @param source [String, GraphQL::Language::Nodes::Document] the request string or parsed AST. - # @param operation_name [String, nil] operation name selected for the request. - # @param variables [Hash, nil] input variables for the request. - # @param context [Hash, nil] a contextual object passed through resolver flows. + # @rbs! + # @prepared_document: DocumentNode? + # @string: String? + # @digest: String? + # @normalized_string: String? + # @normalized_digest: String? + # @operation: OperationNode? + # @operation_directives: String? + # @variable_definitions: VariableDefinitions? + # @fragment_definitions: FragmentDefinitions? + # @plan: Plan? + # @variables: Variables? + + #: ( + #| Supergraph supergraph, + #| String | DocumentNode source, + #| ?operation_name: String?, + #| ?variables: Variables?, + #| ?context: untyped + #| ) -> void def initialize(supergraph, source, operation_name: nil, variables: nil, context: nil) @supergraph = supergraph @prepared_document = nil @@ -57,31 +68,32 @@ def initialize(supergraph, source, operation_name: nil, variables: nil, context: @context[:request] = self end + #: -> DocumentNode def original_document @query.document end - # @return [String] the original document string, or a print of the parsed AST document. + #: -> String def string with_prepared_document { @string || normalized_string } end - # @return [String] a print of the parsed AST document with consistent whitespace. + #: -> String def normalized_string @normalized_string ||= prepared_document.to_query_string end - # @return [String] a digest of the original document string. Generally faster but less consistent. + #: -> String def digest @digest ||= Stitching.digest.call("#{Stitching::VERSION}/#{string}") end - # @return [String] a digest of the normalized document string. Slower but more consistent. + #: -> String def normalized_digest @normalized_digest ||= Stitching.digest.call("#{Stitching::VERSION}/#{normalized_string}") end - # @return [GraphQL::Language::Nodes::OperationDefinition] The selected root operation for the request. + #: -> OperationNode def operation @operation ||= with_prepared_document do selected_op = @query.selected_operation @@ -95,11 +107,12 @@ def operation end end + #: -> String? def operation_name operation.name end - - # @return [String] A string of directives applied to the root operation. These are passed through in all subgraph requests. + + #: -> String? def operation_directives @operation_directives ||= unless operation.directives.empty? printer = GraphQL::Language::Printer.new @@ -107,64 +120,51 @@ def operation_directives end end - # @return [Boolean] true if operation type is a query + #: -> bool def query? @query.query? end - # @return [Boolean] true if operation type is a mutation + #: -> bool def mutation? @query.mutation? end - # @return [Boolean] true if operation type is a subscription + #: -> bool def subscription? @query.subscription? end - # @return [Hash] provided variables hash filled in with default values from definitions + #: -> Variables def variables @variables || with_prepared_document { @variables } end - # @return [Hash] map of variable names to AST type definitions. + #: -> VariableDefinitions def variable_definitions @variable_definitions ||= operation.variables.each_with_object({}) do |v, memo| memo[v.name] = v.type end end - # @return [Hash] map of fragment names to their AST definitions. + #: -> FragmentDefinitions def fragment_definitions @fragment_definitions ||= prepared_document.definitions.each_with_object({}) do |d, memo| memo[d.name] = d if d.is_a?(GraphQL::Language::Nodes::FragmentDefinition) end end - # Validates the request using the combined supergraph schema. - # @return [Array] an array of static validation errors + #: -> Array[GraphQL::ExecutionError] def validate @query.static_errors end - # @return [Boolean] is the request valid? + #: -> bool def valid? validate.empty? end - # Gets and sets the query plan for the request. Assigned query plans may pull from a cache, - # which is useful for redundant GraphQL documents (commonly sent by frontend clients). - # ```ruby - # if cached_plan = $cache.get(request.digest) - # plan = GraphQL::Stitching::Plan.from_json(JSON.parse(cached_plan)) - # request.plan(plan) - # else - # plan = request.plan - # $cache.set(request.digest, JSON.generate(plan.as_json)) - # end - # ``` - # @param new_plan [Plan, nil] a cached query plan for the request. - # @return [Plan] query plan for the request. + #: (?untyped new_plan) -> Plan def plan(new_plan = nil) if new_plan raise StitchingError, "Plan must be a `GraphQL::Stitching::Plan`." unless new_plan.is_a?(Plan) @@ -174,9 +174,7 @@ def plan(new_plan = nil) end end - # Executes the request and returns the rendered response. - # @param raw [Boolean] specifies the result should be unshaped without pruning or null bubbling. Useful for debugging. - # @return [Hash] the rendered GraphQL response with "data" and "errors" sections. + #: (?raw: bool) -> GraphQL::Query::Result def execute(raw: false) add_subscription_update_handler if subscription? Executor.new(self).perform(raw: raw) @@ -184,17 +182,18 @@ def execute(raw: false) private - # Prepares the request for stitching by applying @skip/@include conditionals. + #: -> DocumentNode def prepared_document @prepared_document || with_prepared_document { @prepared_document } end - def with_prepared_document + #: [T] () { () -> T } -> T + def with_prepared_document(&block) unless @prepared_document @variables = @query.variables.to_h @prepared_document = if @string.nil? || @string.match?(SKIP_INCLUDE_DIRECTIVE) - changed = false + changed = false #: bool doc = SkipInclude.render(@query.document, @variables) { changed = true } @string = @normalized_string = doc.to_query_string if changed doc @@ -202,10 +201,10 @@ def with_prepared_document @query.document end end - yield + block.call end - # Adds a handler into context for enriching subscription updates with stitched data + #: -> void def add_subscription_update_handler request = self @context[:stitch_subscription_update] = -> (result) { @@ -213,7 +212,7 @@ def add_subscription_update_handler request, data: result.to_h["data"] || {}, errors: result.to_h["errors"] || [], - after: request.plan.ops.first.step, + after: request.plan.ops.fetch(0).step, ).perform result.to_h.merge!(stitched_result.to_h) diff --git a/lib/graphql/stitching/request/skip_include.rb b/lib/graphql/stitching/request/skip_include.rb index d5b0196c..3c8f55a4 100644 --- a/lib/graphql/stitching/request/skip_include.rb +++ b/lib/graphql/stitching/request/skip_include.rb @@ -1,15 +1,13 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Request - # Faster implementation of an AST visitor for prerendering - # @skip and @include conditional directives into a document. - # This avoids unnecessary planning steps, and prepares result shaping. - # @api private class SkipInclude class << self - def render(document, variables) - changed = false + #: (DocumentNode document, Variables variables) { (DocumentNode) -> void } -> DocumentNode + def render(document, variables, &block) + changed = false #: bool definitions = document.definitions.map do |original_definition| definition = render_node(original_definition, variables) changed ||= definition.object_id != original_definition.object_id @@ -19,14 +17,15 @@ def render(document, variables) return document unless changed document = document.merge(definitions: definitions) - yield(document) if block_given? + block.call(document) if block document end private + #: ((SelectionSetNode) parent_node, Variables variables) -> SelectionSetNode def render_node(parent_node, variables) - changed = false + changed = false #: bool filtered_selections = parent_node.selections.filter_map do |original_node| node = prune_node(original_node, variables) if node.nil? @@ -50,10 +49,11 @@ def render_node(parent_node, variables) end end + #: (SelectionSetNode node, Variables variables) -> SelectionSetNode? def prune_node(node, variables) return node if node.directives.empty? - delete_node = false + delete_node = false #: bool filtered_directives = node.directives.reject do |directive| if directive.name == "skip" delete_node = assess_condition(directive.arguments.first, variables) @@ -73,6 +73,7 @@ def prune_node(node, variables) end end + #: (untyped arg, Variables variables) -> bool def assess_condition(arg, variables) if arg.value.is_a?(GraphQL::Language::Nodes::VariableIdentifier) variables[arg.value.name] || variables[arg.value.name.to_sym] diff --git a/lib/graphql/stitching/supergraph.rb b/lib/graphql/stitching/supergraph.rb index a25d1d67..69bb3268 100644 --- a/lib/graphql/stitching/supergraph.rb +++ b/lib/graphql/stitching/supergraph.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require_relative "supergraph/types" require_relative "supergraph/from_definition" @@ -11,17 +12,39 @@ module Stitching class Supergraph SUPERGRAPH_LOCATION = "__super" - # @return [GraphQL::Schema] the composed schema for the supergraph. + #: singleton(GraphQL::Schema) attr_reader :schema - # @return [Hash] a map of executable resources by location. + #: Hash[Location, Executable] attr_reader :executables + #: TypeResolverMap attr_reader :resolvers + + #: Hash[TypeName, CompositeType] attr_reader :memoized_schema_types + + #: Hash[TypeName, GraphQL::Schema::Member] attr_reader :memoized_introspection_types + + #: LocationsByTypeAndField attr_reader :locations_by_type_and_field + # @rbs! + # @resolvers_by_version: Hash[String, TypeResolver]? + # @fields_by_type_and_location: FieldsByTypeAndLocation? + # @locations_by_type: LocationsByType? + # @memoized_schema_fields: Hash[TypeName, Hash[FieldName, GraphQL::Schema::Field]] + # @possible_keys_by_type: Hash[TypeName, Array[TypeResolver::Key]] + # @possible_keys_by_type_and_location: Hash[TypeName, Hash[Location, Array[TypeResolver::Key]]] + + #: ( + #| schema: singleton(GraphQL::Schema), + #| ?fields: LocationsByTypeAndField, + #| ?resolvers: TypeResolverMap, + #| ?visibility_profiles: Array[String], + #| ?executables: Hash[Location | Symbol, Executable] + #| ) -> void def initialize(schema:, fields: {}, resolvers: {}, visibility_profiles: [], executables: {}) @schema = schema @resolvers = resolvers @@ -58,26 +81,31 @@ def initialize(schema:, fields: {}, resolvers: {}, visibility_profiles: [], exec end end + #: (?visibility_profile: String?) -> String def to_definition(visibility_profile: nil) @schema.to_definition(context: { visibility_profile: visibility_profile, }.tap(&:compact!)) end + #: -> Hash[String, TypeResolver] def resolvers_by_version - @resolvers_by_version ||= resolvers.values.tap(&:flatten!).each_with_object({}) do |resolver, memo| + @resolvers_by_version ||= resolvers.values.flatten.each_with_object({}) do |resolver, memo| memo[resolver.version] = resolver end end + #: -> LocationsByTypeAndField def fields @locations_by_type_and_field.reject { |k, _v| memoized_introspection_types[k] } end + #: -> Array[Location] def locations @executables.each_key.reject { _1 == SUPERGRAPH_LOCATION } end + #: (TypeName type_name) -> Hash[FieldName, GraphQL::Schema::Field] def memoized_schema_fields(type_name) @memoized_schema_fields[type_name] ||= begin fields = @memoized_schema_types[type_name].fields @@ -95,6 +123,7 @@ def memoized_schema_fields(type_name) end end + #: (Location location, String source, Variables variables, Request request) -> untyped def execute_at_location(location, source, variables, request) executable = executables[location] @@ -115,7 +144,7 @@ def execute_at_location(location, source, variables, request) end # inverts fields map to provide fields for a type/location - # "Type" => "location" => ["field1", "field2", ...] + #: -> FieldsByTypeAndLocation def fields_by_type_and_location @fields_by_type_and_location ||= @locations_by_type_and_field.each_with_object({}) do |(type_name, fields), memo| memo[type_name] = fields.each_with_object({}) do |(field_name, locations), memo| @@ -127,7 +156,7 @@ def fields_by_type_and_location end end - # "Type" => ["location1", "location2", ...] + #: -> LocationsByType def locations_by_type @locations_by_type ||= @locations_by_type_and_field.each_with_object({}) do |(type_name, fields), memo| memo[type_name] = fields.values.tap(&:flatten!).tap(&:uniq!) @@ -135,32 +164,33 @@ def locations_by_type end # collects all possible resolver keys for a given type - # ("Type") => [Key("id"), ...] + #: (TypeName type_name) -> Array[TypeResolver::Key] def possible_keys_for_type(type_name) @possible_keys_by_type[type_name] ||= begin if type_name == @schema.query.graphql_name GraphQL::Stitching::EMPTY_ARRAY else - @resolvers[type_name].map(&:key).uniq(&:to_definition) + (@resolvers[type_name] || GraphQL::Stitching::EMPTY_ARRAY).map(&:key).uniq(&:to_definition) end end end # collects possible resolver keys for a given type and location - # ("Type", "location") => [Key("id"), ...] + #: (TypeName type_name, Location location) -> Array[TypeResolver::Key] def possible_keys_for_type_and_location(type_name, location) possible_keys_by_type = @possible_keys_by_type_and_location[type_name] ||= {} possible_keys_by_type[location] ||= possible_keys_for_type(type_name).select do |key| next true if key.locations.include?(location) # Outbound-only locations without resolver queries may dynamically match primitive keys - location_fields = fields_by_type_and_location[type_name][location] || GraphQL::Stitching::EMPTY_ARRAY + location_fields = fields_by_type_and_location[type_name]&.[](location) || GraphQL::Stitching::EMPTY_ARRAY location_fields.include?(key.primitive_name) end end # For a given type, route from one origin location to one or more remote locations # used to connect a partial type across locations via resolver queries + #: (TypeName type_name, Location start_location, Enumerable[Location] goal_locations) -> TypeResolverRoutes def route_type_to_locations(type_name, start_location, goal_locations) key_count = possible_keys_for_type(type_name).length @@ -177,7 +207,7 @@ def route_type_to_locations(type_name, start_location, goal_locations) else # types with a single key attribute must all be within a single hop of each other, # so can use a simple match to collect resolvers for the goal locations. - @resolvers[type_name].each_with_object({}) do |resolver, memo| + (@resolvers[type_name] || GraphQL::Stitching::EMPTY_ARRAY).each_with_object({}) do |resolver, memo| if goal_locations.include?(resolver.location) memo[resolver.location] = [resolver] end @@ -188,9 +218,19 @@ def route_type_to_locations(type_name, start_location, goal_locations) private class PathNode - attr_reader :location, :key, :resolver + #: Location + attr_reader :location + + #: TypeResolver::Key + attr_reader :key + + #: TypeResolver? + attr_reader :resolver + + #: Integer attr_accessor :cost + #: (location: Location, key: TypeResolver::Key, ?resolver: TypeResolver?, ?cost: Integer) -> void def initialize(location:, key:, resolver: nil, cost: 0) @location = location @key = key @@ -201,21 +241,26 @@ def initialize(location:, key:, resolver: nil, cost: 0) # tunes A* search to favor paths with fewest joining locations, ie: # favor longer paths through target locations over shorter paths with additional locations. + #: (TypeName type_name, Location start_location, Enumerable[Location] goal_locations) -> TypeResolverRoutes def route_type_to_locations_via_search(type_name, start_location, goal_locations) results = {} costs = {} - paths = possible_keys_for_type_and_location(type_name, start_location).map do |possible_key| - [PathNode.new(location: start_location, key: possible_key)] + paths = [] #: Array[Array[PathNode]] + possible_keys_for_type_and_location(type_name, start_location).each do |possible_key| + paths << [PathNode.new(location: start_location, key: possible_key)] end while !paths.empty? path = paths.pop - current_location = path.last.location - current_key = path.last.key - current_cost = path.last.cost + next unless path + + last_node = path.fetch(-1) + current_location = last_node.location + current_key = last_node.key + current_cost = last_node.cost - @resolvers[type_name].each do |resolver| + (@resolvers[type_name] || GraphQL::Stitching::EMPTY_ARRAY).each do |resolver| forward_location = resolver.location next if current_key != resolver.key next if path.any? { _1.location == forward_location } @@ -237,10 +282,10 @@ def route_type_to_locations_via_search(type_name, start_location, goal_locations results[forward_location] = path.map(&:resolver) end else - path.last.cost += 1 + path.fetch(-1).cost += 1 end - forward_cost = path.last.cost + forward_cost = path.fetch(-1).cost costs[forward_location] = forward_cost if forward_cost < best_cost possible_keys_for_type_and_location(type_name, forward_location).each do |possible_key| @@ -249,7 +294,7 @@ def route_type_to_locations_via_search(type_name, start_location, goal_locations end paths.sort! do |a, b| - cost_diff = b.last.cost - a.last.cost + cost_diff = b.fetch(-1).cost - a.fetch(-1).cost cost_diff.zero? ? b.length - a.length : cost_diff end end diff --git a/lib/graphql/stitching/supergraph/from_definition.rb b/lib/graphql/stitching/supergraph/from_definition.rb index b7295bb9..9c09d826 100644 --- a/lib/graphql/stitching/supergraph/from_definition.rb +++ b/lib/graphql/stitching/supergraph/from_definition.rb @@ -1,14 +1,17 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Supergraph class << self + #: (Location | Symbol location, untyped executable) -> bool def validate_executable!(location, executable) return true if executable.is_a?(Class) && executable <= GraphQL::Schema return true if executable && executable.respond_to?(:call) raise StitchingError, "Invalid executable provided for location `#{location}`." end + #: (String | singleton(GraphQL::Schema) schema, executables: Hash[Location | Symbol, Executable]) -> Supergraph def from_definition(schema, executables:) if schema.is_a?(String) schema = if GraphQL::Stitching.supports_visibility? @@ -18,9 +21,9 @@ def from_definition(schema, executables:) end end - field_map = {} - resolver_map = {} - possible_locations = {} + field_map = {} #: LocationsByTypeAndField + resolver_map = {} #: TypeResolverMap + possible_locations = {} #: Hash[Location, bool] visibility_definition = schema.directives[GraphQL::Stitching.visibility_directive] visibility_profiles = visibility_definition&.get_argument("profiles")&.default_value || EMPTY_ARRAY @@ -46,7 +49,7 @@ def from_definition(schema, executables:) kwargs = d.arguments.keyword_arguments resolver_map[type_name] ||= [] - resolver_map[type_name] << TypeResolver.new( + resolver_map.fetch(type_name) << TypeResolver.new( location: kwargs[:location], type_name: kwargs.fetch(:type_name, type_name), field: kwargs[:field], @@ -60,16 +63,16 @@ def from_definition(schema, executables:) type.fields.each do |field_name, field| # Collection locations for each field definition - field.directives.each do |d| - next unless d.graphql_name == Directives::SupergraphSource.graphql_name - - location = d.arguments.keyword_arguments[:location] - field_map[type_name] ||= {} - field_map[type_name][field_name] ||= [] - field_map[type_name][field_name] << location - possible_locations[location] = true + field.directives.each do |d| + next unless d.graphql_name == Directives::SupergraphSource.graphql_name + + location = d.arguments.keyword_arguments[:location] + field_map[type_name] ||= {} + field_map.fetch(type_name)[field_name] ||= [] + field_map.fetch(type_name).fetch(field_name) << location + possible_locations[location] = true + end end - end end executables = possible_locations.each_key.each_with_object({}) do |location, memo| diff --git a/lib/graphql/stitching/supergraph/types.rb b/lib/graphql/stitching/supergraph/types.rb index b6f000fc..8a5f5449 100644 --- a/lib/graphql/stitching/supergraph/types.rb +++ b/lib/graphql/stitching/supergraph/types.rb @@ -1,13 +1,16 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class Supergraph module Visibility + #: (GraphQL::Query::Context ctx) -> bool def visible?(ctx) profile = ctx[:visibility_profile] return true if profile.nil? - directive = directives.find { _1.graphql_name == GraphQL::Stitching.visibility_directive } + owner = self #: untyped + directive = owner.directives.find { _1.graphql_name == GraphQL::Stitching.visibility_directive } return true if directive.nil? profiles = directive.arguments.keyword_arguments[:profiles] @@ -16,7 +19,7 @@ def visible?(ctx) profiles.include?(profile) end end - + class ArgumentType < GraphQL::Schema::Argument include Visibility end @@ -35,7 +38,8 @@ module InterfaceType include GraphQL::Schema::Interface field_class(FieldType) - definition_methods do + interface_type = self #: untyped + interface_type.definition_methods do include Visibility end end @@ -53,7 +57,7 @@ class EnumType < GraphQL::Schema::Enum extend Visibility enum_value_class(EnumValueType) end - + class ScalarType < GraphQL::Schema::Scalar extend Visibility end diff --git a/lib/graphql/stitching/type_resolver.rb b/lib/graphql/stitching/type_resolver.rb index 869906b2..6a0e429b 100644 --- a/lib/graphql/stitching/type_resolver.rb +++ b/lib/graphql/stitching/type_resolver.rb @@ -1,37 +1,45 @@ # frozen_string_literal: true +# typed: true require_relative "type_resolver/arguments" require_relative "type_resolver/keys" module GraphQL module Stitching - # Defines a type resolver query that provides direct access to an entity type. class TypeResolver extend ArgumentsParser extend KeysParser class << self - # only intended for testing... + #: -> bool def use_static_version? @use_static_version ||= false end end - # location name providing the resolver query. + #: Location attr_reader :location - # name of merged type fulfilled through this resolver. + #: TypeName? attr_reader :type_name - # name of the root field to query. + #: FieldName? attr_reader :field - # a key field to select from prior locations, sent as resolver argument. + #: Key? attr_reader :key - # parsed resolver Argument structures. + #: Array[Argument] attr_reader :arguments + #: ( + #| location: Location, + #| ?type_name: TypeName?, + #| ?list: bool, + #| ?field: FieldName?, + #| ?key: Key?, + #| ?arguments: Array[Argument]? + #| ) -> void def initialize( location:, type_name: nil, @@ -42,41 +50,45 @@ def initialize( ) @location = location @type_name = type_name - @list = list + @list = list #: bool @field = field @key = key - @arguments = arguments + @arguments = arguments || [] end - # specifies when the resolver is a list query. + #: -> bool def list? @list end + #: -> String def version @version ||= if self.class.use_static_version? - [location, field, key.to_definition, type_name].join(".") + [location, field, key&.to_definition, type_name].join(".") else Stitching.digest.call("#{Stitching::VERSION}/#{as_json.to_json}") end end + #: (untyped other) -> bool def ==(other) self.class == other.class && self.as_json == other.as_json end + #: -> JsonMap def as_json { location: location, type_name: type_name, list: list?, field: field, - key: key.to_definition, + key: key&.to_definition, arguments: arguments.map(&:to_definition).join(", "), argument_types: arguments.map(&:to_type_definition).join(", "), }.tap(&:compact!) end + #: -> String def inspect as_json.to_json end diff --git a/lib/graphql/stitching/type_resolver/arguments.rb b/lib/graphql/stitching/type_resolver/arguments.rb index e2382dac..8314f3b2 100644 --- a/lib/graphql/stitching/type_resolver/arguments.rb +++ b/lib/graphql/stitching/type_resolver/arguments.rb @@ -1,29 +1,37 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class TypeResolver - # Defines a single resolver argument structure - # @api private class Argument + #: String attr_reader :name + + #: ArgumentValue attr_reader :value + + #: TypeName? attr_reader :type_name + #: (name: String, value: ArgumentValue, ?list: bool, ?type_name: TypeName?) -> void def initialize(name:, value:, list: false, type_name: nil) @name = name @value = value - @list = list + @list = list #: bool @type_name = type_name end + #: -> bool def list? @list end + #: -> bool def key? value.key? end + #: (Key key) -> bool def verify_key(key) if key? value.verify_key(self, key) @@ -33,6 +41,7 @@ def verify_key(key) end end + #: (untyped other) -> bool def ==(other) self.class == other.class && @name == other.name && @@ -41,93 +50,106 @@ def ==(other) @list == other.list? end + #: (Data origin_obj) -> untyped def build(origin_obj) value.build(origin_obj) end + #: -> String def print "#{name}: #{value.print}" end + #: -> String def to_definition print.gsub(%|"|, "'") end alias_method :to_s, :to_definition + #: -> String def to_type_definition "#{name}: #{to_type_signature}" end + #: -> String def to_type_signature # need to derive nullability... list? ? "[#{@type_name}!]!" : "#{@type_name}!" end end - # An abstract argument input value - # @api private class ArgumentValue + #: untyped attr_reader :value + #: (untyped value) -> void def initialize(value) @value = value end + #: -> bool def key? false end + #: (Argument arg, Key key) -> void def verify_key(arg, key) nil end + #: (untyped other) -> bool def ==(other) self.class == other.class && value == other.value end + #: (Data origin_obj) -> untyped def build(origin_obj) value end + #: -> String def print value end end - # An object input value - # @api private class ObjectArgumentValue < ArgumentValue + #: -> bool def key? value.any?(&:key?) end + #: (Argument arg, Key key) -> void def verify_key(arg, key) value.each { _1.verify_key(key) } end + #: (Data origin_obj) -> Variables def build(origin_obj) value.each_with_object({}) do |arg, memo| memo[arg.name] = arg.build(origin_obj) end end + #: -> String def print "{#{value.map(&:print).join(", ")}}" end end - # A key input value - # @api private class KeyArgumentValue < ArgumentValue + #: (String | Array[String] value) -> void def initialize(value) super(Array(value)) end + #: -> bool def key? true end + #: (Argument arg, Key key) -> void def verify_key(arg, key) key_field = value.reduce(TypeResolver::KeyField.new("", inner: key)) do |field, ns| if ns == TYPENAME @@ -144,37 +166,31 @@ def verify_key(arg, key) end end + #: (Data origin_obj) -> untyped def build(origin_obj) value.each_with_index.reduce(origin_obj) do |obj, (ns, idx)| obj[idx.zero? ? TypeResolver.export_key(ns) : ns] end end + #: -> String def print "$.#{value.join(".")}" end end - # A typed enum input value - # @api private class EnumArgumentValue < ArgumentValue end - # A primitive input value literal - # @api private class LiteralArgumentValue < ArgumentValue + #: -> String def print JSON.generate(value) end end - # Parser for building argument templates into resolver structures - # @api private module ArgumentsParser - # Parses an argument template string into resolver arguments via schema casting. - # @param template [String] the template string to parse. - # @param field_def [GraphQL::Schema::FieldDefinition] a field definition providing arguments schema. - # @return [[GraphQL::Stitching::TypeResolver::Argument]] an array of resolver arguments. + #: (String template, GraphQL::Schema::Field field_def) -> Array[Argument] def parse_arguments_with_field(template, field_def) ast = parse_arg_defs(template) args = build_argument_set(ast, field_def.arguments) @@ -182,10 +198,10 @@ def parse_arguments_with_field(template, field_def) next unless arg.key? if field_def.type.list? && !arg.list? - raise CompositionError, "Cannot use repeatable key for `#{field_def.owner.graphql_name}.#{field_def.graphql_name}` " \ + Kernel.raise CompositionError, "Cannot use repeatable key for `#{field_def.owner.graphql_name}.#{field_def.graphql_name}` " \ "in non-list argument `#{arg.name}`." elsif !field_def.type.list? && arg.list? - raise CompositionError, "Cannot use non-repeatable key for `#{field_def.owner.graphql_name}.#{field_def.graphql_name}` " \ + Kernel.raise CompositionError, "Cannot use non-repeatable key for `#{field_def.owner.graphql_name}.#{field_def.graphql_name}` " \ "in list argument `#{arg.name}`." end end @@ -193,10 +209,7 @@ def parse_arguments_with_field(template, field_def) args end - # Parses an argument template string into resolver arguments via SDL casting. - # @param template [String] the template string to parse. - # @param type_defs [String] the type definition string declaring argument types. - # @return [[GraphQL::Stitching::TypeResolver::Argument]] an array of resolver arguments. + #: (String template, String type_defs) -> Array[Argument] def parse_arguments_with_type_defs(template, type_defs) type_map = parse_type_defs(type_defs) parse_arg_defs(template).map { build_argument(_1, type_struct: type_map[_1.name]) } @@ -204,6 +217,7 @@ def parse_arguments_with_type_defs(template, type_defs) private + #: (String template) -> Array[GraphQL::Language::Nodes::Argument] def parse_arg_defs(template) template = template .gsub("'", %|"|) # 'sfoo' -> "sfoo" @@ -218,6 +232,7 @@ def parse_arg_defs(template) .arguments end + #: (String template) -> ResolverArgumentTypeMap def parse_type_defs(template) GraphQL.parse("type T { #{template} }") .definitions.first @@ -226,11 +241,12 @@ def parse_type_defs(template) end end + #: (Array[GraphQL::Language::Nodes::Argument] nodes, untyped argument_defs) -> Array[Argument] def build_argument_set(nodes, argument_defs) if argument_defs argument_defs.each_value do |argument_def| if argument_def.type.non_null? && !nodes.find { _1.name == argument_def.graphql_name } - raise CompositionError, "Required argument `#{argument_def.graphql_name}` has no input." + Kernel.raise CompositionError, "Required argument `#{argument_def.graphql_name}` has no input." end end end @@ -238,7 +254,7 @@ def build_argument_set(nodes, argument_defs) nodes.map do |node| argument_def = if argument_defs arg = argument_defs[node.name] - raise CompositionError, "Input `#{node.name}` is not a valid argument." unless arg + Kernel.raise CompositionError, "Input `#{node.name}` is not a valid argument." unless arg arg end @@ -246,6 +262,7 @@ def build_argument_set(nodes, argument_defs) end end + #: (GraphQL::Language::Nodes::Argument node, ?argument_def: GraphQL::Schema::Argument?, ?type_struct: Array[Util::TypeStructure]?) -> Argument def build_argument(node, argument_def: nil, type_struct: nil) value = if node.value.is_a?(GraphQL::Language::Nodes::InputObject) build_object_value(node.value, argument_def ? argument_def.type.unwrap : nil) @@ -266,12 +283,13 @@ def build_argument(node, argument_def: nil, type_struct: nil) ) end + #: (GraphQL::Language::Nodes::InputObject node, untyped object_def) -> ObjectArgumentValue def build_object_value(node, object_def) if object_def if !object_def.kind.input_object? && !object_def.kind.scalar? - raise CompositionError, "Objects can only be built into input object and scalar positions." + Kernel.raise CompositionError, "Objects can only be built into input object and scalar positions." elsif object_def.kind.scalar? && GraphQL::Schema::BUILT_IN_TYPES[object_def.graphql_name] - raise CompositionError, "Objects can only be built into custom scalar types." + Kernel.raise CompositionError, "Objects can only be built into custom scalar types." elsif object_def.kind.scalar? object_def = nil end diff --git a/lib/graphql/stitching/type_resolver/keys.rb b/lib/graphql/stitching/type_resolver/keys.rb index 41fdce14..773be289 100644 --- a/lib/graphql/stitching/type_resolver/keys.rb +++ b/lib/graphql/stitching/type_resolver/keys.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true module GraphQL::Stitching class TypeResolver @@ -12,6 +13,7 @@ class FieldNode GRAPHQL_RUBY_FIELD_ALIAS_KWARG = !GraphQL::Language::Nodes::Field.new(field_alias: "a").alias.nil? class << self + #: (field_name: FieldName, ?field_alias: String?, ?selections: Array[SelectionNode]) -> GraphQL::Language::Nodes::Field def build(field_name:, field_alias: nil, selections: GraphQL::Stitching::EMPTY_ARRAY) if GRAPHQL_RUBY_FIELD_ALIAS_KWARG GraphQL::Language::Nodes::Field.new( @@ -20,37 +22,53 @@ def build(field_name:, field_alias: nil, selections: GraphQL::Stitching::EMPTY_A selections: selections, ) else - GraphQL::Language::Nodes::Field.new( - alias: field_alias, - name: field_name, - selections: selections, - ) + GraphQL::Language::Nodes::Field.new(**legacy_field_kwargs(field_alias, field_name, selections)) end end + + private + + #: (String? field_alias, FieldName field_name, Array[SelectionNode] selections) -> untyped + def legacy_field_kwargs(field_alias, field_name, selections) + { + alias: field_alias, + name: field_name, + selections: selections, + } + end end end class KeyFieldSet < Array + # @rbs! + # @to_definition: String? + # @export_nodes: Array[GraphQL::Language::Nodes::Field]? + + #: (Array[KeyField] fields) -> void def initialize(fields) super(fields.sort_by(&:name)) @to_definition = nil @export_nodes = nil end + #: (untyped other) -> bool def ==(other) to_definition == other.to_definition end + #: -> FieldName? def primitive_name - length == 1 ? first.name : nil + length == 1 ? fetch(0).name : nil end + #: -> String def to_definition @to_definition ||= map(&:to_definition).join(" ").freeze end alias_method :to_s, :to_definition + #: -> Array[GraphQL::Language::Nodes::Field] def export_nodes @export_nodes ||= map(&:export_node) end @@ -63,8 +81,10 @@ def export_nodes ) class Key < KeyFieldSet + #: Array[Location] attr_reader :locations + #: (Array[KeyField] fields, ?locations: Array[Location]) -> void def initialize(fields, locations: GraphQL::Stitching::EMPTY_ARRAY) super(fields) @locations = locations @@ -73,6 +93,7 @@ def initialize(fields, locations: GraphQL::Stitching::EMPTY_ARRAY) freeze end + #: -> Array[GraphQL::Language::Nodes::Field] def export_nodes @export_nodes ||= begin nodes = map(&:export_node) @@ -83,27 +104,32 @@ def export_nodes end class KeyField - # name of the key, may be a field alias + #: FieldName attr_reader :name - # inner key selections + #: KeyFieldSet attr_reader :inner - # optional information about location and typing, used during composition + #: TypeName? attr_accessor :type_name + + #: bool? attr_accessor :list alias_method :list?, :list + #: (FieldName name, ?root: bool, ?inner: KeyFieldSet) -> void def initialize(name, root: false, inner: EMPTY_FIELD_SET) @name = name @inner = inner - @root = root + @root = root #: bool end + #: -> String def to_definition @inner.empty? ? @name : "#{@name} { #{@inner.to_definition} }" end + #: -> GraphQL::Language::Nodes::Field def export_node FieldNode.build( field_alias: @root ? "#{EXPORT_PREFIX}#{@name}" : nil, @@ -114,20 +140,24 @@ def export_node end module KeysParser + #: (String name) -> String def export_key(name) "#{EXPORT_PREFIX}#{name}" end + #: (String? name) -> bool def export_key?(name) return false unless name name.start_with?(EXPORT_PREFIX) end + #: (String template, ?Array[Location] locations) -> Key def parse_key(template, locations = GraphQL::Stitching::EMPTY_ARRAY) Key.new(parse_field_set(template), locations: locations) end + #: (String template, SubgraphTypesByLocation subgraph_types_by_location) -> Key def parse_key_with_types(template, subgraph_types_by_location) field_set = parse_field_set(template) locations = subgraph_types_by_location.filter_map do |location, subgraph_type| @@ -137,15 +167,16 @@ def parse_key_with_types(template, subgraph_types_by_location) if locations.none? message = "Key `#{field_set.to_definition}` does not exist in any location." message += " Composite key selections may not be distributed." if field_set.length > 1 - raise CompositionError, message + Kernel.raise CompositionError, message end - assign_field_set_info!(field_set, subgraph_types_by_location[locations.first]) + assign_field_set_info!(field_set, subgraph_types_by_location.fetch(locations.fetch(0))) Key.new(field_set, locations: locations) end private + #: (String template) -> KeyFieldSet def parse_field_set(template) template = template.strip template = template[1..-2] if template.start_with?("{") && template.end_with?("}") @@ -154,12 +185,16 @@ def parse_field_set(template) build_field_set(ast, root: true) end + #: (Array[SelectionNode] selections, ?root: bool) -> KeyFieldSet def build_field_set(selections, root: false) return EMPTY_FIELD_SET if selections.empty? fields = selections.map do |node| - raise CompositionError, "Key selections must be fields." unless node.is_a?(GraphQL::Language::Nodes::Field) - raise CompositionError, "Key fields may not specify aliases." unless node.alias.nil? + unless node.is_a?(GraphQL::Language::Nodes::Field) + Kernel.raise CompositionError, "Key selections must be fields." + end + + Kernel.raise CompositionError, "Key fields may not specify aliases." unless node.alias.nil? KeyField.new(node.name, inner: build_field_set(node.selections), root: root) end @@ -167,6 +202,7 @@ def build_field_set(selections, root: false) KeyFieldSet.new(fields) end + #: (KeyFieldSet field_set, untyped subgraph_type) -> bool def field_set_matches_type?(field_set, subgraph_type) subgraph_type = subgraph_type.unwrap field_set.all? do |field| @@ -176,16 +212,18 @@ def field_set_matches_type?(field_set, subgraph_type) end end + #: (KeyField field, untyped subgraph_type) -> bool def field_matches_type?(field, subgraph_type) return false if subgraph_type.nil? if field.inner.empty? && subgraph_type.kind.composite? - raise CompositionError, "Composite key fields must contain nested selections." + Kernel.raise CompositionError, "Composite key fields must contain nested selections." end field.inner.empty? || field_set_matches_type?(field.inner, subgraph_type) end + #: (KeyFieldSet field_set, untyped subgraph_type) -> void def assign_field_set_info!(field_set, subgraph_type) subgraph_type = subgraph_type.unwrap field_set.each do |field| @@ -195,6 +233,7 @@ def assign_field_set_info!(field_set, subgraph_type) end end + #: (KeyField field, untyped subgraph_type) -> void def assign_field_info!(field, subgraph_type) field.list = subgraph_type.list? field.type_name = subgraph_type.unwrap.graphql_name diff --git a/lib/graphql/stitching/util.rb b/lib/graphql/stitching/util.rb index 3b98f73f..6c57b3e1 100644 --- a/lib/graphql/stitching/util.rb +++ b/lib/graphql/stitching/util.rb @@ -1,48 +1,54 @@ # frozen_string_literal: true +# typed: true module GraphQL module Stitching - # General utilities to aid with stitching. class Util class TypeStructure + #: TypeName? attr_reader :name - + + #: (list: bool, null: bool, name: TypeName?) -> void def initialize(list:, null:, name:) - @list = list - @null = null + @list = list #: bool + @null = null #: bool @name = name end + #: -> bool def list? @list end - + + #: -> bool def null? @null end + #: -> bool def non_null? !@null end + #: (untyped other) -> bool def ==(other) @list == other.list? && @null == other.null? && @name == other.name end end class << self - # specifies if a type is a primitive leaf value + #: (untyped type) -> bool def is_leaf_type?(type) type.kind.scalar? || type.kind.enum? end - # strips non-null wrappers from a type + #: (untyped type) -> untyped def unwrap_non_null(type) type = type.of_type while type.non_null? type end - # builds a single-dimensional representation of a wrapped type structure + #: (untyped type) -> Array[TypeStructure] def flatten_type_structure(type) structure = [] @@ -65,49 +71,38 @@ def flatten_type_structure(type) structure end - # builds a single-dimensional representation of a wrapped type structure from AST + #: ( + #| GraphQL::Language::Nodes::WrapperType | GraphQL::Language::Nodes::TypeName ast, + #| ?structure: Array[TypeStructure] + #| ) -> Array[TypeStructure] def flatten_ast_type_structure(ast, structure: []) - null = true + nullable = true #: bool + current_ast = ast #: untyped - while ast.is_a?(GraphQL::Language::Nodes::NonNullType) - ast = ast.of_type - null = false + while current_ast.is_a?(GraphQL::Language::Nodes::NonNullType) + current_ast = current_ast.of_type + nullable = false end - if ast.is_a?(GraphQL::Language::Nodes::ListType) + if current_ast.is_a?(GraphQL::Language::Nodes::ListType) structure << TypeStructure.new( list: true, - null: null, + null: nullable, name: nil, ) - flatten_ast_type_structure(ast.of_type, structure: structure) + flatten_ast_type_structure(current_ast.of_type, structure: structure) else structure << TypeStructure.new( list: false, - null: null, - name: ast.name, + null: nullable, + name: current_ast.name, ) end structure end - # expands interfaces and unions to an array of their memberships - # like `schema.possible_types`, but includes child interfaces - def expand_abstract_type(schema, parent_type) - return [] unless parent_type.kind.abstract? - return parent_type.possible_types if parent_type.kind.union? - - result = [] - schema.types.each_value do |type| - next unless type <= GraphQL::Schema::Interface && type != parent_type - next unless type.interfaces.include?(parent_type) - result << type - result.push(*expand_abstract_type(schema, type)) if type.kind.interface? - end - result.tap(&:uniq!) - end end end end diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 00000000..9b0d82e2 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,6 @@ +--dir +lib +--dir +sorbet/rbi +--parser=prism +--enable-experimental-rbs-comments diff --git a/sorbet/rbi/annotations/.gitattributes b/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 00000000..d2eacd2c --- /dev/null +++ b/sorbet/rbi/annotations/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-vendored=true diff --git a/sorbet/rbi/annotations/graphql.rbi b/sorbet/rbi/annotations/graphql.rbi new file mode 100644 index 00000000..50868230 --- /dev/null +++ b/sorbet/rbi/annotations/graphql.rbi @@ -0,0 +1,55 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module GraphQL + class << self + # @version >= 2.3.1 + sig { params(graphql_string: String, trace: T.untyped, filename: T.untyped, max_tokens: T.untyped).returns(GraphQL::Language::Nodes::Document) } + def parse(graphql_string, trace: T.unsafe(nil), filename: T.unsafe(nil), max_tokens: T.unsafe(nil)); end + end +end + +class GraphQL::Backtrace + Elem = type_member { { fixed: T.untyped } } +end + +class GraphQL::Schema + class << self + sig { params(query_str: String, kwargs: T.untyped).returns(GraphQL::Query::Result) } + def execute(query_str = T.unsafe(nil), **kwargs); end + end +end + +class GraphQL::Schema::InputObject < ::GraphQL::Schema::Member + sig { returns(GraphQL::Query::Context) } + def context; end +end + +class GraphQL::Schema::Object < ::GraphQL::Schema::Member + sig { returns(GraphQL::Query::Context) } + def context; end +end + +class GraphQL::Schema::Resolver + sig { returns(GraphQL::Query::Context) } + def context; end +end + +module GraphQL::Schema::Member::HasFields + # @version >= 2.5.17 + sig { params(name_positional: T.untyped, type_positional: T.untyped, desc_positional: T.untyped, kwargs: T.untyped, block: T.nilable(T.proc.params(field: GraphQL::Schema::Field).bind(GraphQL::Schema::Field).void)).returns(T.untyped) } + def field(name_positional = T.unsafe(nil), type_positional = T.unsafe(nil), desc_positional = T.unsafe(nil), **kwargs, &block); end +end + +module GraphQL::Schema::Member::BaseDSLMethods + sig { params(new_description: String).returns(T.nilable(String)) } + def description(new_description = T.unsafe(nil)); end +end + +module GraphQL::Schema::Interface + mixes_in_class_methods ::GraphQL::Schema::Member::BaseDSLMethods + mixes_in_class_methods ::GraphQL::Schema::Member::HasFields +end diff --git a/sorbet/rbi/annotations/minitest.rbi b/sorbet/rbi/annotations/minitest.rbi new file mode 100644 index 00000000..a7059f09 --- /dev/null +++ b/sorbet/rbi/annotations/minitest.rbi @@ -0,0 +1,120 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Minitest::Assertions + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def assert(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(MatchData) } + def assert_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_nil(obj, msg = nil); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(stdout: T.nilable(T.any(String, Regexp)), stderr: T.nilable(T.any(String, Regexp)), block: T.proc.void).returns(T::Boolean) } + def assert_output(stdout = nil, stderr = nil, &block); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def assert_path_exists(path, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def assert_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def assert_predicate(o1, op, msg = nil); end + + sig { params(exp: NilClass, block: T.proc.void).returns(StandardError) } + sig { type_parameters(:T).params(exp: T.any(T::Class[T.type_parameter(:T)], Regexp, String), block: T.proc.void).returns(T.type_parameter(:T)) } + def assert_raises(*exp, &block); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def assert_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_same(exp, act, msg = nil); end + + # @version < 6.0.0 + sig { params(send_ary: T::Array[T.anything], m: T.anything).returns(T::Boolean) } + def assert_send(send_ary, m = nil); end + + sig { params(block: T.proc.void).returns(T::Boolean) } + def assert_silent(&block); end + + sig { params(sym: Symbol, msg: T.anything, block: T.proc.void).returns(T.anything) } + def assert_throws(sym, msg = nil, &block); end + + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def refute(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_nil(obj, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def refute_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def refute_path_exists(path, msg = nil); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def refute_predicate(o1, op, msg = nil); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def refute_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_same(exp, act, msg = nil); end +end diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 00000000..d9bb82a4 --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/graphql@2.6.3.rbi b/sorbet/rbi/gems/graphql@2.6.3.rbi new file mode 100644 index 00000000..4e77d393 --- /dev/null +++ b/sorbet/rbi/gems/graphql@2.6.3.rbi @@ -0,0 +1,19806 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `graphql` gem. +# Please instead update this file by running `bin/tapioca gem graphql`. + + +# pkg:gem/graphql#lib/graphql/autoload.rb:3 +module GraphQL + extend ::GraphQL::Autoload + + class << self + # pkg:gem/graphql#lib/graphql.rb:39 + def default_parser; end + + # pkg:gem/graphql#lib/graphql.rb:43 + def default_parser=(_arg0); end + + # Load all `autoload`-configured classes, and also eager-load dependents who have autoloads of their own. + # + # pkg:gem/graphql#lib/graphql.rb:14 + def eager_load!; end + + # Turn a query string or schema definition into an AST + # @param graphql_string [String] a GraphQL query string or schema definition + # @return [GraphQL::Language::Nodes::Document] + # + # pkg:gem/graphql#lib/graphql.rb:49 + def parse(graphql_string, trace: T.unsafe(nil), filename: T.unsafe(nil), max_tokens: T.unsafe(nil)); end + + # Read the contents of `filename` and parse them as GraphQL + # @param filename [String] Path to a `.graphql` file containing IDL or query + # @return [GraphQL::Language::Nodes::Document] + # + # pkg:gem/graphql#lib/graphql.rb:56 + def parse_file(filename); end + + # pkg:gem/graphql#lib/graphql.rb:66 + def parse_with_racc(string, filename: T.unsafe(nil), trace: T.unsafe(nil)); end + + # If true, the parser should raise when an integer or float is followed immediately by an identifier (instead of a space or punctuation) + # + # pkg:gem/graphql#lib/graphql.rb:84 + def reject_numbers_followed_by_names; end + + # If true, the parser should raise when an integer or float is followed immediately by an identifier (instead of a space or punctuation) + # + # pkg:gem/graphql#lib/graphql.rb:84 + def reject_numbers_followed_by_names=(_arg0); end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql.rb:62 + def scan(graphql_string); end + + # pkg:gem/graphql#lib/graphql.rb:71 + def scan_with_ruby(graphql_string); end + end +end + +# pkg:gem/graphql#lib/graphql/analysis/visitor.rb:3 +module GraphQL::Analysis + private + + # pkg:gem/graphql#lib/graphql/analysis.rb:90 + def analysis_errors(parent_errors, results); end + + # Analyze a multiplex, and all queries within. + # Multiplex analyzers are ran for all queries, keeping state. + # Query analyzers are ran per query, without carrying state between queries. + # + # @param multiplex [GraphQL::Execution::Multiplex] + # @param analyzers [Array] + # @return [Array] Results from multiplex analyzers + # + # pkg:gem/graphql#lib/graphql/analysis.rb:27 + def analyze_multiplex(multiplex, analyzers); end + + # @param query [GraphQL::Query] + # @param analyzers [Array] + # @return [Array] Results from those analyzers + # + # pkg:gem/graphql#lib/graphql/analysis.rb:56 + def analyze_query(query, analyzers, multiplex_analyzers: T.unsafe(nil)); end + + class << self + # pkg:gem/graphql#lib/graphql/analysis.rb:90 + def analysis_errors(parent_errors, results); end + + # Analyze a multiplex, and all queries within. + # Multiplex analyzers are ran for all queries, keeping state. + # Query analyzers are ran per query, without carrying state between queries. + # + # @param multiplex [GraphQL::Execution::Multiplex] + # @param analyzers [Array] + # @return [Array] Results from multiplex analyzers + # + # pkg:gem/graphql#lib/graphql/analysis.rb:27 + def analyze_multiplex(multiplex, analyzers); end + + # @param query [GraphQL::Query] + # @param analyzers [Array] + # @return [Array] Results from those analyzers + # + # pkg:gem/graphql#lib/graphql/analysis.rb:56 + def analyze_query(query, analyzers, multiplex_analyzers: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/analysis.rb:11 +GraphQL::Analysis::AST = GraphQL::Analysis + +# Query analyzer for query ASTs. Query analyzers respond to visitor style methods +# but are prefixed by `enter` and `leave`. +# +# When an analyzer is initialized with a Multiplex, you can always get the current query from +# `visitor.query` in the visit methods. +# +# @param [GraphQL::Query, GraphQL::Execution::Multiplex] The query or multiplex to analyze +# +# pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:11 +class GraphQL::Analysis::Analyzer + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:12 + def initialize(subject); end + + # Analyzer hook to decide at analysis time whether a query should + # be analyzed or not. + # @return [Boolean] If the query should be analyzed or not + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:27 + def analyze?; end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_abstract_node(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_argument(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_directive(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_document(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_enum(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_fragment_spread(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_inline_fragment(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_input_object(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_list_type(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_non_null_type(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_null_value(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_operation_definition(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_type_name(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_variable_definition(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_enter_variable_identifier(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_abstract_node(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_argument(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_directive(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_document(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_enum(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_fragment_spread(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_inline_fragment(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_input_object(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_list_type(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_non_null_type(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_null_value(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_operation_definition(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_type_name(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_variable_definition(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:50 + def on_leave_variable_identifier(node, parent, visitor); end + + # The result for this analyzer. Returning {GraphQL::AnalysisError} results + # in a query error. + # @return [Any] The analyzer result + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:41 + def result; end + + # Analyzer hook to decide at analysis time whether analysis + # requires a visitor pass; can be disabled for precomputed results. + # @return [Boolean] If analysis requires visitation or not + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:34 + def visit?; end + + protected + + # @return [GraphQL::Execution::Multiplex, nil] `nil` if this analyzer is visiting a query + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:87 + def multiplex; end + + # @return [GraphQL::Query, nil] `nil` if this analyzer is visiting a multiplex + # (When this is `nil`, use `visitor.query` inside visit methods to get the current query) + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:84 + def query; end + + # @return [GraphQL::Query, GraphQL::Execution::Multiplex] Whatever this analyzer is analyzing + # + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:80 + def subject; end + + class << self + private + + # pkg:gem/graphql#lib/graphql/analysis/analyzer.rb:49 + def build_visitor_hooks(member_name); end + end +end + +# pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:4 +class GraphQL::Analysis::FieldUsage < ::GraphQL::Analysis::Analyzer + # pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:5 + def initialize(query); end + + # pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:13 + def on_leave_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:26 + def result; end + + private + + # pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:37 + def extract_deprecated_arguments(argument_values); end + + # pkg:gem/graphql#lib/graphql/analysis/field_usage.rb:74 + def extract_deprecated_enum_value(enum_type, value); end +end + +# Used under the hood to implement complexity validation, +# see {Schema#max_complexity} and {Query#max_complexity} +# +# pkg:gem/graphql#lib/graphql/analysis/max_query_complexity.rb:6 +class GraphQL::Analysis::MaxQueryComplexity < ::GraphQL::Analysis::QueryComplexity + # pkg:gem/graphql#lib/graphql/analysis/max_query_complexity.rb:7 + def result; end +end + +# pkg:gem/graphql#lib/graphql/analysis/max_query_depth.rb:4 +class GraphQL::Analysis::MaxQueryDepth < ::GraphQL::Analysis::QueryDepth + # pkg:gem/graphql#lib/graphql/analysis/max_query_depth.rb:5 + def result; end +end + +# Calculate the complexity of a query, using {Field#complexity} values. +# +# pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:5 +class GraphQL::Analysis::QueryComplexity < ::GraphQL::Analysis::Analyzer + # State for the query complexity calculation: + # - `complexities_on_type` holds complexity scores for each type + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:8 + def initialize(query); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:80 + def on_enter_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:98 + def on_leave_field(node, parent, visitor); end + + # Override this method to use the complexity result + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:17 + def result; end + + private + + # A hook which is called whenever a field's max complexity is calculated. + # Override this method to capture individual field complexity details. + # + # @param scoped_type_complexity [ScopedTypeComplexity] + # @param max_complexity [Numeric] Field's maximum complexity including child complexity + # @param child_complexity [Numeric, nil] Field's child complexity + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:188 + def field_complexity(scoped_type_complexity, max_complexity:, child_complexity: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:237 + def legacy_merged_max_complexity(query, inner_selections); end + + # @return [Integer] + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:111 + def max_possible_complexity(mode: T.unsafe(nil)); end + + # @param inner_selections [Array>] Field selections for a scope + # @return [Integer] Total complexity value for all these selections in the parent scope + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:193 + def merged_max_complexity(query, inner_selections); end + + # @param query [GraphQL::Query] Used for `query.possible_types` + # @param scopes [Array] Array of scoped type complexities + # @param mode [:future, :legacy] + # @return [Integer] + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:121 + def merged_max_complexity_for_scopes(query, scopes, mode); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:162 + def types_intersect?(query, a, b); end +end + +# ScopedTypeComplexity models a tree of GraphQL types mapped to inner selections, ie: +# Hash> +# +# pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:48 +class GraphQL::Analysis::QueryComplexity::ScopedTypeComplexity < ::Hash + # @param parent_type [Class] The owner of `field_definition` + # @param field_definition [GraphQL::Field, GraphQL::Schema::Field] Used for getting the `.complexity` configuration + # @param query [GraphQL::Query] Used for `query.possible_types` + # @param response_path [Array] The path to the response key for the field + # @return [Hash>] + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:59 + def initialize(parent_type, field_definition, query, response_path); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:75 + def composite?; end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:52 + def field_definition; end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:69 + def nodes; end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:71 + def own_complexity(child_complexity); end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:52 + def query; end + + # pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:52 + def response_path; end +end + +# A proc for defaulting empty namespace requests as a new scope hash. +# +# pkg:gem/graphql#lib/graphql/analysis/query_complexity.rb:50 +GraphQL::Analysis::QueryComplexity::ScopedTypeComplexity::DEFAULT_PROC = T.let(T.unsafe(nil), Proc) + +# A query reducer for measuring the depth of a given query. +# +# See https://graphql-ruby.org/queries/ast_analysis.html for more examples. +# +# @example Logging the depth of a query +# class LogQueryDepth < GraphQL::Analysis::QueryDepth +# def result +# log("GraphQL query depth: #{@max_depth}") +# end +# end +# +# # In your Schema file: +# +# class MySchema < GraphQL::Schema +# query_analyzer LogQueryDepth +# end +# +# # When you run the query, the depth will get logged: +# +# Schema.execute(query_str) +# # GraphQL query depth: 8 +# +# pkg:gem/graphql#lib/graphql/analysis/query_depth.rb:26 +class GraphQL::Analysis::QueryDepth < ::GraphQL::Analysis::Analyzer + # pkg:gem/graphql#lib/graphql/analysis/query_depth.rb:27 + def initialize(query); end + + # pkg:gem/graphql#lib/graphql/analysis/query_depth.rb:34 + def on_enter_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/query_depth.rb:42 + def on_leave_field(node, parent, visitor); end + + # pkg:gem/graphql#lib/graphql/analysis/query_depth.rb:53 + def result; end +end + +# pkg:gem/graphql#lib/graphql/analysis.rb:13 +class GraphQL::Analysis::TimeoutError < ::GraphQL::AnalysisError + # pkg:gem/graphql#lib/graphql/analysis.rb:14 + def initialize(*_arg0, **_arg1, &_arg2); end +end + +# Depth first traversal through a query AST, calling AST analyzers +# along the way. +# +# The visitor is a special case of GraphQL::Language::StaticVisitor, visiting +# only the selected operation, providing helpers for common use cases such +# as skipped fields and visiting fragment spreads. +# +# @see {GraphQL::Analysis::Analyzer} AST Analyzers for queries +# +# pkg:gem/graphql#lib/graphql/analysis/visitor.rb:12 +class GraphQL::Analysis::Visitor < ::GraphQL::Language::StaticVisitor + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:13 + def initialize(query:, analyzers:, timeout:); end + + # @return [GraphQL::Argument, nil] The most-recently-entered GraphQL::Argument, if currently inside one + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:235 + def argument_definition; end + + # @return [GraphQL::Execution::Interpreter::Arguments] Arguments for this node, merging default values, literal values and query variables + # @see {GraphQL::Query#arguments_for} + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:53 + def arguments_for(ast_node, field_definition); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_enter_operation_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:78 + def call_on_leave_operation_definition(node, parent); end + + # @return [GraphQL::Directive, nil] The most-recently-entered GraphQL::Directive, if currently inside one + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:230 + def directive_definition; end + + # @return [GraphQL::Field, nil] The most-recently-entered GraphQL::Field, if currently inside one + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:220 + def field_definition; end + + # @return [Array] Types whose scope we've entered + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:39 + def object_types; end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:168 + def on_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:158 + def on_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:130 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:194 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:111 + def on_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:99 + def on_operation_definition(node, parent); end + + # @return [GraphQL::BaseType] The type which the current type came from + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:215 + def parent_type_definition; end + + # @return [GraphQL::Argument, nil] The previous GraphQL argument + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:240 + def previous_argument_definition; end + + # @return [GraphQL::Field, nil] The GraphQL field which returned the object that the current field belongs to + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:225 + def previous_field_definition; end + + # @return [GraphQL::Query] the query being visited + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:36 + def query; end + + # @return [Array] The path to the response key for the current field + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:68 + def response_path; end + + # @return [Boolean] If the current node should be skipped because of a skip or include directive + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:63 + def skipping?; end + + # @return [GraphQL::BaseType] The current object type + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:210 + def type_definition; end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:44 + def visit; end + + # @return [Boolean] If the visitor is currently inside a fragment definition + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:58 + def visiting_fragment_definition?; end + + private + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:273 + def check_timeout; end + + # Visit a fragment spread inline instead of visiting the definition + # by itself. + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:248 + def enter_fragment_spread_inline(fragment_spread); end + + # Visit a fragment spread inline instead of visiting the definition + # by itself. + # + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:264 + def leave_fragment_spread_inline(_fragment_spread); end + + # pkg:gem/graphql#lib/graphql/analysis/visitor.rb:268 + def skip?(ast_node); end +end + +# pkg:gem/graphql#lib/graphql/analysis_error.rb:3 +class GraphQL::AnalysisError < ::GraphQL::ExecutionError; end + +# @see GraphQL::Railtie for automatic Rails integration +# +# pkg:gem/graphql#lib/graphql/autoload.rb:5 +module GraphQL::Autoload + # Register a constant named `const_name` to be loaded from `path`. + # This is like `Kernel#autoload` but it tracks the constants so they can be eager-loaded with {#eager_load!} + # @param const_name [Symbol] + # @param path [String] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/autoload.rb:11 + def autoload(const_name, path); end + + # Call this to load this constant's `autoload` dependents and continue calling recursively + # @return [void] + # + # pkg:gem/graphql#lib/graphql/autoload.rb:20 + def eager_load!; end + + private + + # @return [Boolean] `true` if GraphQL-Ruby is currently eager-loading its constants + # + # pkg:gem/graphql#lib/graphql/autoload.rb:34 + def eager_loading?; end +end + +# Wrap unhandled errors with {TracedError}. +# +# {TracedError} provides a GraphQL backtrace with arguments and return values. +# The underlying error is available as {TracedError#cause}. +# +# @example toggling backtrace annotation +# class MySchema < GraphQL::Schema +# if Rails.env.development? || Rails.env.test? +# use GraphQL::Backtrace +# end +# end +# +# pkg:gem/graphql#lib/graphql/backtrace/table.rb:3 +class GraphQL::Backtrace + include ::Enumerable + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/backtrace.rb:27 + def initialize(context, value: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/backtrace.rb:21 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/backtrace.rb:21 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/backtrace.rb:31 + def inspect; end + + # pkg:gem/graphql#lib/graphql/backtrace.rb:37 + def to_a; end + + # pkg:gem/graphql#lib/graphql/backtrace.rb:35 + def to_s; end + + class << self + # pkg:gem/graphql#lib/graphql/backtrace.rb:23 + def use(schema_defn); end + end +end + +# A class for turning a context into a human-readable table or array +# +# pkg:gem/graphql#lib/graphql/backtrace/table.rb:5 +class GraphQL::Backtrace::Table + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:16 + def initialize(context, value:); end + + # @return [Array] An array of position + field name entries + # + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:27 + def to_backtrace; end + + # @return [String] A table layout of backtrace with metadata + # + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:22 + def to_table; end + + private + + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:123 + def find_ast_node(node, last_part); end + + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:182 + def inspect_result(obj); end + + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:199 + def inspect_truncated(obj); end + + # @return [String] + # + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:138 + def render_table(rows); end + + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:38 + def rows; end + + # pkg:gem/graphql#lib/graphql/backtrace/table.rb:174 + def value_at(runtime, path); end +end + +# pkg:gem/graphql#lib/graphql/backtrace/table.rb:8 +GraphQL::Backtrace::Table::HEADERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/backtrace/table.rb:7 +GraphQL::Backtrace::Table::MAX_COL_WIDTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/backtrace/table.rb:6 +GraphQL::Backtrace::Table::MIN_COL_WIDTH = T.let(T.unsafe(nil), Integer) + +# When {Backtrace} is enabled, raised errors are wrapped with {TracedError}. +# +# pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:5 +class GraphQL::Backtrace::TracedError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:28 + def initialize(err, current_ctx); end + + # @return [GraphQL::Query::Context] The context at the field where the error was raised + # + # pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:10 + def context; end + + # @return [Array] Printable backtrace of GraphQL error context + # + # pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:7 + def graphql_backtrace; end +end + +# This many lines of the original Ruby backtrace +# are included in the message +# +# pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:26 +GraphQL::Backtrace::TracedError::CAUSE_BACKTRACE_PREVIEW_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/backtrace/traced_error.rb:12 +GraphQL::Backtrace::TracedError::MESSAGE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/coercion_error.rb:3 +class GraphQL::CoercionError < ::GraphQL::ExecutionError; end + +# This module exposes Fiber-level runtime information. +# +# It won't work across unrelated fibers, although it will work in child Fibers. +# +# @example Setting Up ActiveRecord::QueryLogs +# +# config.active_record.query_log_tags = [ +# :namespaced_controller, +# :action, +# :job, +# # ... +# { +# # GraphQL runtime info: +# current_graphql_operation: -> { GraphQL::Current.operation_name }, +# current_graphql_field: -> { GraphQL::Current.field&.path }, +# current_dataloader_source: -> { GraphQL::Current.dataloader_source_class }, +# # ... +# }, +# ] +# +# pkg:gem/graphql#lib/graphql/current.rb:24 +module GraphQL::Current + class << self + # @return [GraphQL::Dataloader::Source, nil] The currently-running source, if there is one + # + # pkg:gem/graphql#lib/graphql/current.rb:59 + def dataloader_source; end + + # @return [Class, nil] The currently-running {Dataloader::Source} class, if there is one. + # + # pkg:gem/graphql#lib/graphql/current.rb:54 + def dataloader_source_class; end + + # @see GraphQL::Field#path for a string identifying this field + # @return [GraphQL::Field, nil] The currently-running field, if there is one. + # + # pkg:gem/graphql#lib/graphql/current.rb:43 + def field; end + + # @return [String, nil] Comma-joined operation names for the currently-running {Execution::Multiplex}. `nil` if all operations are anonymous. + # + # pkg:gem/graphql#lib/graphql/current.rb:26 + def operation_name; end + end +end + +# This plugin supports Fiber-based concurrency, along with {GraphQL::Dataloader::Source}. +# +# @example Installing Dataloader +# +# class MySchema < GraphQL::Schema +# use GraphQL::Dataloader +# end +# +# @example Waiting for batch-loaded data in a GraphQL field +# +# field :team, Types::Team, null: true +# +# def team +# dataloader.with(Sources::Record, Team).load(object.team_id) +# end +# +# pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:4 +class GraphQL::Dataloader + # pkg:gem/graphql#lib/graphql/dataloader.rb:60 + def initialize(nonblocking: T.unsafe(nil), fiber_limit: T.unsafe(nil)); end + + # @api private Nothing to see here + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:144 + def append_job(callable = T.unsafe(nil), &job); end + + # This method is called when Dataloader is finished using a fiber. + # Use it to perform any cleanup, such as releasing database connections (if required manually) + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:102 + def cleanup_fiber; end + + # Clear any already-loaded objects from {Source} caches + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:153 + def clear_cache; end + + # @return [Integer, nil] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:71 + def fiber_limit; end + + # This is called before the fiber is spawned, from the parent context (i.e. from + # the thread or fiber that it is scheduled from). + # + # @return [Hash] Current fiber-local variables + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:81 + def get_fiber_variables; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:246 + def lazy_at_depth(depth, lazy); end + + # Pre-warm the Dataloader cache with ActiveRecord objects which were loaded elsewhere. + # These will be used by {Dataloader::ActiveRecordSource}, {Dataloader::ActiveRecordAssociationSource} and their helper + # methods, `dataload_record` and `dataload_association`. + # @param records [Array] Already-loaded records to warm the cache with + # @param index_by [Symbol] The attribute to use as the cache key. (Should match `find_by:` when using {ActiveRecordSource}) + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:265 + def merge_records(records, index_by: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:73 + def nonblocking?; end + + # @param trace_query_lazy [nil, Execution::Multiplex] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:198 + def run(trace_query_lazy: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:241 + def run_fiber(f); end + + # Use a self-contained queue for the work in the block. + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:161 + def run_isolated; end + + # Set up the fiber variables in a new fiber. + # + # This is called within the fiber, right after it is spawned. + # + # @param vars [Hash] Fiber-local variables from {get_fiber_variables} + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:95 + def set_fiber_variables(vars); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:250 + def spawn_fiber; end + + # truffle-ruby wasn't doing well with the implementation below + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:121 + def with(source_class, *batch_args, **batch_kwargs); end + + # Tell the dataloader that this fiber is waiting for data. + # + # Dataloader will resume the fiber after the requested data has been loaded (by another Fiber). + # + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:135 + def yield(source = T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/dataloader.rb:330 + def calculate_fiber_limit; end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:341 + def join_queues(prev_queue, new_queue); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:277 + def run_next_pending_lazies(job_fibers, trace); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:297 + def run_pending_steps(trace, job_fibers, next_job_fibers, jobs_fiber_limit, source_fibers, next_source_fibers, total_fiber_limit); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:347 + def spawn_job_fiber(trace); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:359 + def spawn_source_fiber(trace); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:321 + def with_trace_query_lazy(multiplex_or_nil, &block); end + + class << self + # pkg:gem/graphql#lib/graphql/dataloader.rb:29 + def default_fiber_limit; end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:29 + def default_fiber_limit=(_arg0); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:29 + def default_nonblocking; end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:29 + def default_nonblocking=(_arg0); end + + # pkg:gem/graphql#lib/graphql/dataloader.rb:32 + def use(schema, nonblocking: T.unsafe(nil), fiber_limit: T.unsafe(nil)); end + + # Call the block with a Dataloader instance, + # then run all enqueued jobs and return the result of the block. + # + # pkg:gem/graphql#lib/graphql/dataloader.rb:50 + def with_dataloading(&block); end + end +end + +# pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:7 +class GraphQL::Dataloader::ActiveRecordAssociationSource < ::GraphQL::Dataloader::Source + # pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:10 + def initialize(association, scope = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:31 + def fetch(records); end + + # pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:23 + def load(record); end + + class << self + # pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:15 + def batch_key_for(association, scope = T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/dataloader/active_record_association_source.rb:8 +GraphQL::Dataloader::ActiveRecordAssociationSource::RECORD_SOURCE_CLASS = GraphQL::Dataloader::ActiveRecordSource + +# pkg:gem/graphql#lib/graphql/dataloader/active_record_source.rb:6 +class GraphQL::Dataloader::ActiveRecordSource < ::GraphQL::Dataloader::Source + # pkg:gem/graphql#lib/graphql/dataloader/active_record_source.rb:7 + def initialize(model_class, find_by: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader/active_record_source.rb:32 + def fetch(record_ids); end + + # pkg:gem/graphql#lib/graphql/dataloader/active_record_source.rb:22 + def normalize_fetch_key(requested_key); end + + # pkg:gem/graphql#lib/graphql/dataloader/active_record_source.rb:18 + def result_key_for(requested_key); end +end + +# pkg:gem/graphql#lib/graphql/dataloader/async_dataloader.rb:4 +class GraphQL::Dataloader::AsyncDataloader < ::GraphQL::Dataloader + # pkg:gem/graphql#lib/graphql/dataloader/async_dataloader.rb:17 + def run(trace_query_lazy: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader/async_dataloader.rb:5 + def yield(source = T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/dataloader/async_dataloader.rb:70 + def run_pending_steps(job_fibers, next_job_fibers, source_tasks, jobs_fiber_limit, trace); end + + # pkg:gem/graphql#lib/graphql/dataloader/async_dataloader.rb:83 + def spawn_source_task(parent_task, condition, trace); end +end + +# GraphQL-Ruby uses this when Dataloader isn't enabled. +# +# It runs execution code inline and gathers lazy objects (eg. Promises) +# and resolves them during {#run}. +# +# pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:9 +class GraphQL::Dataloader::NullDataloader < ::GraphQL::Dataloader + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:10 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:59 + def append_job(callable = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:53 + def clear_cache; end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:14 + def freeze; end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:20 + def run(trace_query_lazy: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:39 + def run_isolated; end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:64 + def with(*_arg0); end + + # pkg:gem/graphql#lib/graphql/dataloader/null_dataloader.rb:55 + def yield(_source); end +end + +# @see Source#request which returns an instance of this +# +# pkg:gem/graphql#lib/graphql/dataloader/request.rb:5 +class GraphQL::Dataloader::Request + # pkg:gem/graphql#lib/graphql/dataloader/request.rb:6 + def initialize(source, key); end + + # Call this method to cause the current Fiber to wait for the results of this request. + # + # @return [Object] the object loaded for `key` + # + # pkg:gem/graphql#lib/graphql/dataloader/request.rb:14 + def load; end + + # pkg:gem/graphql#lib/graphql/dataloader/request.rb:18 + def load_with_deprecation_warning; end +end + +# @see Source#request_all which returns an instance of this. +# +# pkg:gem/graphql#lib/graphql/dataloader/request_all.rb:5 +class GraphQL::Dataloader::RequestAll < ::GraphQL::Dataloader::Request + # pkg:gem/graphql#lib/graphql/dataloader/request_all.rb:6 + def initialize(source, keys); end + + # Call this method to cause the current Fiber to wait for the results of this request. + # + # @return [Array] One object for each of `keys` + # + # pkg:gem/graphql#lib/graphql/dataloader/request_all.rb:14 + def load; end +end + +# pkg:gem/graphql#lib/graphql/dataloader/source.rb:5 +class GraphQL::Dataloader::Source + # Clear any already-loaded objects for this source + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:179 + def clear_cache; end + + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:18 + def dataloader; end + + # Subclasses must implement this method to return a value for each of `keys` + # @param keys [Array] keys passed to {#load}, {#load_all}, {#request}, or {#request_all} + # @return [Array] A loaded value for each of `keys`. The array must match one-for-one to the list of `keys`. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:98 + def fetch(keys); end + + # @param value [Object] A loading value which will be passed to {#fetch} if it isn't already in the internal cache. + # @return [Object] The result from {#fetch} for `key`. If `key` hasn't been loaded yet, the Fiber will yield until it's loaded. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:63 + def load(value); end + + # @param values [Array] Loading keys which will be passed to `#fetch` (or read from the internal cache). + # @return [Object] The result from {#fetch} for `keys`. If `keys` haven't been loaded yet, the Fiber will yield until they're loaded. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:76 + def load_all(values); end + + # Add these key-value pairs to this source's cache + # (future loads will use these merged values). + # @param new_results [Hash Object>] key-value pairs to cache in this source + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:129 + def merge(new_results); end + + # Implement this method if varying values given to {load} (etc) should be consolidated + # or normalized before being handed off to your {fetch} implementation. + # + # This is different than {result_key_for} because _that_ method handles unification inside Dataloader's cache, + # but this method changes the value passed into {fetch}. + # + # @param value [Object] The value passed to {load}, {load_all}, {request}, or {request_all} + # @return [Object] The value given to {fetch} + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:46 + def normalize_fetch_key(value); end + + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:184 + def pending; end + + # @return [Boolean] True if this source has any pending requests for data. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:121 + def pending?; end + + # @return [Dataloader::Request] a pending request for a value from `key`. Call `.load` on that object to wait for the result. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:21 + def request(value); end + + # @return [Dataloader::Request] a pending request for a values from `keys`. Call `.load` on that object to wait for the results. + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:51 + def request_all(values); end + + # Implement this method to return a stable identifier if different + # key objects should load the same data value. + # + # @param value [Object] A value passed to `.request` or `.load`, for which a value will be loaded + # @return [Object] The key for tracking this pending data + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:34 + def result_key_for(value); end + + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:184 + def results; end + + # Called by {GraphQL::Dataloader} to resolve and pending requests to this source. + # @api private + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:140 + def run_pending_keys; end + + # Called by {Dataloader} to prepare the {Source}'s internal state + # @api private + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:8 + def setup(dataloader); end + + # Wait for a batch, if there's anything to batch. + # Then run the batch and update the cache. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:107 + def sync(pending_result_keys); end + + private + + # Reads and returns the result for the key from the internal cache, or raises an error if the result was an error + # @param key [Object] key passed to {#load} or {#load_all} + # @return [Object] The result from {#fetch} for `key`. + # @api private + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:192 + def result_for(key); end + + class << self + # These arguments are given to `dataloader.with(source_class, ...)`. The object + # returned from this method is used to de-duplicate batch loads under the hood + # by using it as a Hash key. + # + # By default, the arguments are all put in an Array. To customize how this source's + # batches are merged, override this method to return something else. + # + # For example, if you pass `ActiveRecord::Relation`s to `.with(...)`, you could override + # this method to call `.to_sql` on them, thus merging `.load(...)` calls when they apply + # to equivalent relations. + # + # @param batch_args [Array] + # @param batch_kwargs [Hash] + # @return [Object] + # + # pkg:gem/graphql#lib/graphql/dataloader/source.rb:173 + def batch_key_for(*batch_args, **batch_kwargs); end + end +end + +# pkg:gem/graphql#lib/graphql/dataloader/source.rb:103 +GraphQL::Dataloader::Source::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) + +# This error is raised when `Types::ISO8601Date` is asked to return a value +# that cannot be parsed to a Ruby Date. +# +# @see GraphQL::Types::ISO8601Date which raises this error +# +# pkg:gem/graphql#lib/graphql/date_encoding_error.rb:7 +class GraphQL::DateEncodingError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/date_encoding_error.rb:11 + def initialize(value); end + + # The value which couldn't be encoded + # + # pkg:gem/graphql#lib/graphql/date_encoding_error.rb:9 + def date_value; end +end + +# pkg:gem/graphql#lib/graphql/dig.rb:3 +module GraphQL::Dig + # implemented using the old activesupport #dig instead of the ruby built-in + # so we can use some of the magic in Schema::InputObject and Interpreter::Arguments + # to handle stringified/symbolized keys. + # + # @param own_key [String, Symbol] A key to retrieve + # @param rest_keys [Array<[String, Symbol>] Retrieves the value object corresponding to the each key objects repeatedly + # @return [Object] + # + # pkg:gem/graphql#lib/graphql/dig.rb:11 + def dig(own_key, *rest_keys); end +end + +# This error is raised when `Types::ISO8601Duration` is asked to return a value +# that cannot be parsed as an ISO8601-formatted duration by ActiveSupport::Duration. +# +# @see GraphQL::Types::ISO8601Duration which raises this error +# +# pkg:gem/graphql#lib/graphql/duration_encoding_error.rb:7 +class GraphQL::DurationEncodingError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/duration_encoding_error.rb:11 + def initialize(value); end + + # The value which couldn't be encoded + # + # pkg:gem/graphql#lib/graphql/duration_encoding_error.rb:9 + def duration_value; end +end + +# pkg:gem/graphql#lib/graphql.rb:77 +module GraphQL::EmptyObjects; end + +# pkg:gem/graphql#lib/graphql.rb:79 +GraphQL::EmptyObjects::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql.rb:78 +GraphQL::EmptyObjects::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql.rb:21 +class GraphQL::Error < ::StandardError; end + +# pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:3 +module GraphQL::Execution; end + +# Boolean checks for how an AST node's directives should +# influence its execution +# @api private +# +# pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:7 +module GraphQL::Execution::DirectiveChecks + private + + # @return [Boolean] Should this node be included in the query? + # + # pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:14 + def include?(directive_ast_nodes, query); end + + class << self + # @return [Boolean] Should this node be included in the query? + # + # pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:14 + def include?(directive_ast_nodes, query); end + end +end + +# pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:9 +GraphQL::Execution::DirectiveChecks::INCLUDE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/execution/directive_checks.rb:8 +GraphQL::Execution::DirectiveChecks::SKIP = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/execution/errors.rb:5 +class GraphQL::Execution::Errors + class << self + # @return [Proc, nil] The handler for `error_class`, if one was registered on this schema or inherited + # + # pkg:gem/graphql#lib/graphql/execution/errors.rb:56 + def find_handler_for(schema, error_class); end + + # Register this handler, updating the + # internal handler index to maintain least-to-most specific. + # + # @param error_class [Class] + # @param error_handlers [Hash] + # @param error_handler [Proc] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/execution/errors.rb:13 + def register_rescue_from(error_class, error_handlers, error_handler); end + end +end + +# pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:4 +class GraphQL::Execution::FieldResolveStep + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:5 + def initialize(parent_type:, runner:, key:, selections_step:); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:105 + def add_graphql_error(err); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:559 + def add_non_null_error(is_from_array); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:343 + def any_lazy_results?; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:40 + def append_selection(ast_node); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def arguments; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def arguments=(_arg0); end + + # Used for compatibility in Schema::Subscription + # + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:146 + def arguments_without_loads; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def ast_node; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:36 + def ast_nodes; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:552 + def authorized_finished(step); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:126 + def build_arguments; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:114 + def build_errors_result(errors, single_error); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:467 + def build_leaf_result(field_result, return_type, ctx, is_from_array); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:408 + def build_results; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:81 + def call; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:493 + def enqueue_next_steps; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:153 + def execute_field; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def field_definition; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def field_results; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:365 + def finish_extensions; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:460 + def finish_leaf_result(result_h, key, field_result, return_type, ctx); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def key; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def object_is_authorized; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def parent_type; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:32 + def path; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def pending_steps; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def pending_steps=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def runner; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def selections_step; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:564 + def set_current_field(new_value = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def static_type; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:30 + def static_type=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:63 + def sync(lazy); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:51 + def value; end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:27 + def was_scoped; end + + private + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:570 + def build_graphql_result(graphql_result, key, field_result, return_type, is_nn, is_list, is_from_array); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:739 + def error_instance_array(size, err_prototype); end + + # pkg:gem/graphql#lib/graphql/execution/field_resolve_step.rb:633 + def resolve_batch(objects, context, args_hash); end +end + +# pkg:gem/graphql#lib/graphql/execution/finalize.rb:4 +class GraphQL::Execution::Finalize + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:5 + def initialize(query, data, runner); end + + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:54 + def run; end + + private + + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:172 + def check_list_result(result_arr, inner_type, ast_selections); end + + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:96 + def check_object_result(result_h, parent_type, ast_selections); end + + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:91 + def finalizers(result_value, key); end + + # pkg:gem/graphql#lib/graphql/execution/finalize.rb:76 + def run_finalizers(result_path, finalizer_or_finalizers, result_data, result_key); end +end + +# pkg:gem/graphql#lib/graphql/execution/next.rb:12 +module GraphQL::Execution::Finalizer + # pkg:gem/graphql#lib/graphql/execution/next.rb:19 + def ast_node; end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:23 + def ast_node=(new_node); end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:27 + def ast_nodes; end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:27 + def ast_nodes=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:15 + def finalize_graphql_result(query, result_data, result_key); end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:13 + def path; end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:13 + def path=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/execution/next.rb:30 +module GraphQL::Execution::HaltExecution; end + +# pkg:gem/graphql#lib/graphql/execution/input_values.rb:4 +class GraphQL::Execution::InputValues + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:5 + def initialize(query, runner); end + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:38 + def argument_values(owner_defn, argument_nodes, field_resolve_step); end + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:11 + def variable_values; end + + private + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:134 + def argument_value(argument_values, argument_key, argument_definition, arg_value, override_type, field_resolve_step); end + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:308 + def coerce_untyped_input(input_value); end + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:231 + def value_from_ast(value_node, type); end + + # pkg:gem/graphql#lib/graphql/execution/input_values.rb:66 + def variable_value(value, type); end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:5 +class GraphQL::Execution::Interpreter + class << self + # @param schema [GraphQL::Schema] + # @param queries [Array] + # @param context [Hash] + # @param max_complexity [Integer, nil] + # @return [Array] One result per query + # + # pkg:gem/graphql#lib/graphql/execution/interpreter.rb:24 + def run_all(schema, query_options, context: T.unsafe(nil), max_complexity: T.unsafe(nil)); end + end +end + +# A container for metadata regarding arguments present in a GraphQL query. +# @see Interpreter::Arguments#argument_values for a hash of these objects. +# +# pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:8 +class GraphQL::Execution::Interpreter::ArgumentValue + # pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:9 + def initialize(definition:, value:, original_value:, default_used:); end + + # @return [Boolean] `true` if the schema-defined `default_value:` was applied in this case. (No client-provided value was present.) + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:26 + def default_used?; end + + # @return [GraphQL::Schema::Argument] The definition instance for this argument + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:23 + def definition; end + + # @return [Object] The value of this argument _before_ `prepare` is applied. + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:20 + def original_value; end + + # @return [Object] The Ruby-ready value for this Argument + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/argument_value.rb:17 + def value; end +end + +# A wrapper for argument hashes in GraphQL queries. +# +# This object is immutable so that the runtime code can be sure that +# modifications don't leak from one use to another +# +# @see GraphQL::Query#arguments_for to get access to these objects. +# +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:12 +class GraphQL::Execution::Interpreter::Arguments + include ::GraphQL::Dig + extend ::Forwardable + + # @param argument_values [nil, Hash{Symbol => ArgumentValue}] + # @param keyword_arguments [nil, Hash{Symbol => Object}] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:24 + def initialize(argument_values:, keyword_arguments: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def [](*_arg0, **_arg1, &_arg2); end + + # @return [Hash{Symbol => ArgumentValue}] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:56 + def argument_values; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:63 + def each_value(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:58 + def empty?; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def fetch(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:65 + def inspect; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def key?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def keys(*_arg0, **_arg1, &_arg2); end + + # The Ruby-style arguments hash, ready for a resolver. + # This hash is the one used at runtime. + # + # @return [Hash] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:20 + def keyword_arguments; end + + # Create a new arguments instance which includes these extras. + # + # This is called by the runtime to implement field `extras: [...]` + # + # @param extra_args [Hash Object>] + # @return [Interpreter::Arguments] + # @api private + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:76 + def merge_extras(extra_args); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def size(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def to_h(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:62 + def values(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:84 +GraphQL::Execution::Interpreter::Arguments::EMPTY = T.let(T.unsafe(nil), GraphQL::Execution::Interpreter::Arguments) + +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments.rb:83 +GraphQL::Execution::Interpreter::Arguments::NO_ARGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:6 +class GraphQL::Execution::Interpreter::ArgumentsCache + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:7 + def initialize(query); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:35 + def cached_arguments_for(ast_node, argument_owner); end + + # @yield [Interpreter::Arguments, Lazy] The finally-loaded arguments + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:40 + def dataload_for(ast_node, argument_owner, parent_object, &block); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:24 + def fetch(ast_node, argument_owner, parent_object); end + + class << self + # pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:60 + def prepare_args_hash(query, ast_arg_or_hash_or_value); end + end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:57 +GraphQL::Execution::Interpreter::ArgumentsCache::NO_ARGUMENTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/execution/interpreter/arguments_cache.rb:58 +GraphQL::Execution::Interpreter::ArgumentsCache::NO_VALUE_GIVEN = T.let(T.unsafe(nil), Object) + +# pkg:gem/graphql#lib/graphql/execution/interpreter/execution_errors.rb:6 +class GraphQL::Execution::Interpreter::ExecutionErrors + # pkg:gem/graphql#lib/graphql/execution/interpreter/execution_errors.rb:7 + def initialize(ctx, ast_node, path); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/execution_errors.rb:13 + def add(err_or_msg); end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter.rb:140 +class GraphQL::Execution::Interpreter::ListResultFailedError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/execution/interpreter.rb:141 + def initialize(value:, path:, field:); end +end + +# Wrapper for raw values +# +# pkg:gem/graphql#lib/graphql/execution/interpreter/handles_raw_value.rb:7 +class GraphQL::Execution::Interpreter::RawValue + include ::GraphQL::Execution::Finalizer + + # pkg:gem/graphql#lib/graphql/execution/interpreter/handles_raw_value.rb:14 + def initialize(obj = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/handles_raw_value.rb:10 + def finalize_graphql_result(query, result_data, result_key); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/handles_raw_value.rb:18 + def resolve; end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/resolve.rb:6 +module GraphQL::Execution::Interpreter::Resolve + class << self + # @deprecated Call `dataloader.run` instead + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/resolve.rb:43 + def resolve(results, dataloader); end + + # Continue field results in `results` until there's nothing else to continue. + # @return [void] + # @deprecated Call `dataloader.run` instead + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/resolve.rb:10 + def resolve_all(results, dataloader); end + + # @deprecated Call `dataloader.run` instead + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/resolve.rb:17 + def resolve_each_depth(lazies_at_depth, dataloader); end + end +end + +# I think it would be even better if we could somehow make +# `continue_field` not recursive. "Trampolining" it somehow. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:6 +class GraphQL::Execution::Interpreter::Runtime + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:38 + def initialize(query:); end + + # @param obj [Object] Some user-returned value that may want to be batched + # @param field [GraphQL::Schema::Field] + # @param eager [Boolean] Set to `true` for mutation root fields only + # @param trace [Boolean] If `false`, don't wrap this with field tracing + # @return [GraphQL::Execution::Lazy, Object] If loading `object` will be deferred, it's a wrapper over it. + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:913 + def after_lazy(lazy_obj, field:, owner_object:, arguments:, ast_node:, result:, result_name:, runtime_state:, eager: T.unsafe(nil), trace: T.unsafe(nil), &block); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:967 + def arguments(graphql_object, arg_owner, ast_node); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:821 + def call_method_on_directives(method_name, object, directives, &block); end + + # @return [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:36 + def context; end + + # The resolver for `field` returned `value`. Continue to execute the query, + # treating `value` as `type` (probably the return type of the field). + # + # Use `next_selections` to resolve object fields, if there are any. + # + # Location information from `path` and `ast_node`. + # + # @return [Lazy, Array, Hash, Object] Lazy, Array, and Hash are all traversed to resolve lazy values later + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:665 + def continue_field(value, owner_type, field, current_type, ast_node, next_selections, is_non_null, owner_object, arguments, result_name, selection_result, was_scoped, runtime_state); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:558 + def continue_value(value, field, is_non_null, ast_node, result_name, selection_result); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:546 + def current_path; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:976 + def delete_all_interpreter_context; end + + # Check {Schema::Directive.include?} for each directive that's present + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:860 + def directives_include?(node, graphql_object, parent_type, selection_result, extra_path_part); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:199 + def each_gathered_selections(response_hash); end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:329 + def evaluate_selection(result_name, field_ast_nodes_or_ast_node, selections_result); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:377 + def evaluate_selection_with_args(arguments, field_defn, ast_node, field_ast_nodes, object, result_name, selection_result, runtime_state); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:437 + def evaluate_selection_with_resolved_keyword_args(kwarg_arguments, resolved_arguments, field_defn, ast_node, field_ast_nodes, object, result_name, selection_result, runtime_state); end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:291 + def evaluate_selections(gathered_selections, selections_result, target_result, runtime_state); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:58 + def final_result; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:212 + def gather_selections(graphql_response, owner_object, owner_type, selections, selections_to_run, selections_by_name, ordered_result_keys); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:891 + def get_current_runtime_state; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:62 + def inspect; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:1008 + def lazy?(object); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:896 + def minimal_after_lazy(value, &block); end + + # @return [GraphQL::Query] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:30 + def query; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:806 + def resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, owner_type, was_scoped, runtime_state); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:987 + def resolve_type(type, value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:826 + def run_directive(method_name, object, directives, idx, &block); end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:67 + def run_eager; end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:33 + def schema; end + + # Mark this node and any already-registered children as dead, + # so that it accepts no more writes. + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:533 + def set_graphql_dead(selection_result); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:503 + def set_result(selection_result, result_name, value, is_child_result, is_non_null); end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:12 +class GraphQL::Execution::Interpreter::Runtime::CurrentState + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:13 + def initialize; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_arguments; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_arguments=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_field; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_field=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:21 + def current_object; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_result; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_result=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_result_name; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def current_result_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def was_authorized_by_scope_items; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:25 + def was_authorized_by_scope_items=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:7 +module GraphQL::Execution::Interpreter::Runtime::GraphQLResult + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:8 + def initialize(result_name, result_type, application_value, parent_result, is_non_null_in_parent, selections, is_eager, ast_node, graphql_arguments, graphql_field); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def ast_node; end + + # TODO test full path in Partial + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:28 + def base_path=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:34 + def build_path(path_array); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:45 + def depth; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_application_value; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_arguments; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:53 + def graphql_dead; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:53 + def graphql_dead=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_field; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_is_eager; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_is_non_null_in_parent; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_parent; end + + # @return [Hash] Plain-Ruby result data (`@graphql_metadata` contains Result wrapper objects) + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:58 + def graphql_result_data; end + + # @return [Hash] Plain-Ruby result data (`@graphql_metadata` contains Result wrapper objects) + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:58 + def graphql_result_data=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_result_name; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_result_type; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:54 + def graphql_selections; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:30 + def path; end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:175 +class GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray + include ::GraphQL::Execution::Interpreter::Runtime::GraphQLResult + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:178 + def initialize(_result_name, _result_type, _application_value, _parent_result, _is_non_null_in_parent, _selections, _is_eager, _ast_node, _graphql_arguments, graphql_field); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:221 + def [](idx); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:183 + def graphql_skip_at(index); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:205 + def set_child_result(idx, value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:195 + def set_leaf(idx, value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:217 + def values; end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:61 +class GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash + include ::GraphQL::Execution::Interpreter::Runtime::GraphQLResult + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:62 + def initialize(_result_name, _result_type, _application_value, _parent_result, _is_non_null_in_parent, _selections, _is_eager, _ast_node, _graphql_arguments, graphql_field); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:134 + def [](k); end + + # hook for breadth-first implementations to signal when collecting results. + # + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:170 + def collect_result(result_name, result_value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:117 + def delete(key); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:122 + def each; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:161 + def fix_result_order; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:72 + def graphql_merged_into; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:72 + def graphql_merged_into=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:130 + def key?(k); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:138 + def merge_into(into_result); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:68 + def ordered_result_keys; end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:68 + def ordered_result_keys=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:100 + def set_child_result(key, value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:74 + def set_leaf(key, value); end + + # pkg:gem/graphql#lib/graphql/execution/interpreter/runtime/graphql_result.rb:126 + def values; end +end + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:557 +GraphQL::Execution::Interpreter::Runtime::HALT = T.let(T.unsafe(nil), Object) + +# pkg:gem/graphql#lib/graphql/execution/interpreter/runtime.rb:288 +GraphQL::Execution::Interpreter::Runtime::NO_ARGS = T.let(T.unsafe(nil), Hash) + +# This wraps a value which is available, but not yet calculated, like a promise or future. +# +# Calling `#value` will trigger calculation & return the "lazy" value. +# +# This is an itty-bitty promise-like object, with key differences: +# - It has only two states, not-resolved and resolved +# - It has no error-catching functionality +# @api private +# +# pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:11 +class GraphQL::Execution::Lazy + # Create a {Lazy} which will get its inner value by calling the block + # @param field [GraphQL::Schema::Field] + # @param get_value_func [Proc] a block to get the inner value (later) + # + # pkg:gem/graphql#lib/graphql/execution/lazy.rb:20 + def initialize(field: T.unsafe(nil), &get_value_func); end + + # pkg:gem/graphql#lib/graphql/execution/lazy.rb:15 + def field; end + + # @return [Lazy] A {Lazy} whose value depends on another {Lazy}, plus any transformations in `block` + # + # pkg:gem/graphql#lib/graphql/execution/lazy.rb:49 + def then; end + + # @return [Object] The wrapped value, calling the lazy block if necessary + # + # pkg:gem/graphql#lib/graphql/execution/lazy.rb:27 + def value; end + + class << self + # @param lazies [Array] Maybe-lazy objects + # @return [Lazy] A lazy which will sync all of `lazies` + # + # pkg:gem/graphql#lib/graphql/execution/lazy.rb:57 + def all(lazies); end + end +end + +# {GraphQL::Schema} uses this to match returned values to lazy resolution methods. +# Methods may be registered for classes, they apply to its subclasses also. +# The result of this lookup is cached for future resolutions. +# Instances of this class are thread-safe. +# @api private +# @see {Schema#lazy?} looks up values from this map +# +# pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:18 +class GraphQL::Execution::Lazy::LazyMethodMap + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:19 + def initialize(use_concurrent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:39 + def each; end + + # @param value [Object] an object which may have a `lazy_value_method` registered for its class or superclasses + # @return [Symbol, nil] The `lazy_value_method` for this object, or nil + # + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:35 + def get(value); end + + # @param lazy_class [Class] A class which represents a lazy value (subclasses may also be used) + # @param lazy_value_method [Symbol] The method to call on this class to get its value + # + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:29 + def set(lazy_class, lazy_value_method); end + + protected + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:45 + def storage; end + + private + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:49 + def find_superclass_method(value_class); end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:23 + def initialize_copy(other); end +end + +# Mock the Concurrent::Map API +# +# pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:57 +class GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:63 + def initialize; end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:70 + def []=(key, value); end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:76 + def compute_if_absent(key); end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:61 + def each_pair(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:61 + def size(*_arg0, **_arg1, &_arg2); end + + protected + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:89 + def copy_storage; end + + private + + # pkg:gem/graphql#lib/graphql/execution/lazy/lazy_method_map.rb:82 + def initialize_copy(other); end +end + +# This can be used for fields which _had no_ lazy results +# @api private +# +# pkg:gem/graphql#lib/graphql/execution/lazy.rb:65 +GraphQL::Execution::Lazy::NullResult = T.let(T.unsafe(nil), GraphQL::Execution::Lazy) + +# pkg:gem/graphql#lib/graphql/execution/load_argument_step.rb:4 +class GraphQL::Execution::LoadArgumentStep + # pkg:gem/graphql#lib/graphql/execution/load_argument_step.rb:5 + def initialize(field_resolve_step:, arguments:, load_receiver:, argument_value:, argument_definition:, argument_key:); end + + # pkg:gem/graphql#lib/graphql/execution/load_argument_step.rb:42 + def call; end + + # pkg:gem/graphql#lib/graphql/execution/load_argument_step.rb:16 + def value; end + + private + + # pkg:gem/graphql#lib/graphql/execution/load_argument_step.rb:77 + def assign_value; end +end + +# Lookahead creates a uniform interface to inspect the forthcoming selections. +# +# It assumes that the AST it's working with is valid. (So, it's safe to use +# during execution, but if you're using it directly, be sure to validate first.) +# +# A field may get access to its lookahead by adding `extras: [:lookahead]` +# to its configuration. +# +# @example looking ahead in a field +# field :articles, [Types::Article], null: false, +# extras: [:lookahead] +# +# # For example, imagine a faster database call +# # may be issued when only some fields are requested. +# # +# # Imagine that _full_ fetch must be made to satisfy `fullContent`, +# # we can look ahead to see if we need that field. If we do, +# # we make the expensive database call instead of the cheap one. +# def articles(lookahead:) +# if lookahead.selects?(:full_content) +# fetch_full_articles(object) +# else +# fetch_preview_articles(object) +# end +# end +# +# pkg:gem/graphql#lib/graphql/execution/lookahead.rb:29 +class GraphQL::Execution::Lookahead + # @param query [GraphQL::Query] + # @param ast_nodes [Array, Array] + # @param field [GraphQL::Schema::Field] if `ast_nodes` are fields, this is the field definition matching those nodes + # @param root_type [Class] if `ast_nodes` are operation definition, this is the root type for that operation + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:34 + def initialize(query:, ast_nodes:, field: T.unsafe(nil), root_type: T.unsafe(nil), owner_type: T.unsafe(nil)); end + + # Like {#selection}, but for aliases. + # It returns a null object (check with {#selected?}) + # @return [GraphQL::Execution::Lookahead] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:147 + def alias_selection(alias_name, selected_type: T.unsafe(nil), arguments: T.unsafe(nil)); end + + # @return [Hash] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:53 + def arguments; end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:44 + def ast_nodes; end + + # @return [GraphQL::Schema::Field] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:47 + def field; end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:216 + def inspect; end + + # The method name of the field. + # It returns the method_sym of the Lookahead's field. + # + # @example getting the name of a selection + # def articles(lookahead:) + # article.selection(:full_content).name # => :full_content + # # ... + # end + # + # @return [Symbol] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:212 + def name; end + + # @return [GraphQL::Schema::Object, GraphQL::Schema::Union, GraphQL::Schema::Interface] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:50 + def owner_type; end + + # @return [Boolean] True if this lookahead represents a field that was requested + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:107 + def selected?; end + + # Like {#selects?}, but can be used for chaining. + # It returns a null object (check with {#selected?}) + # @param field_name [String, Symbol] + # @return [GraphQL::Execution::Lookahead] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:115 + def selection(field_name, selected_type: T.unsafe(nil), arguments: T.unsafe(nil)); end + + # Like {#selection}, but for all nodes. + # It returns a list of Lookaheads for all Selections + # + # If `arguments:` is provided, each provided key/value will be matched + # against the arguments in each selection. This method will filter the selections + # if any of the given `arguments:` do not match the given selection. + # + # @example getting the name of a selection + # def articles(lookahead:) + # next_lookaheads = lookahead.selections # => [#, ...] + # next_lookaheads.map(&:name) #=> [:full_content, :title] + # end + # + # @param arguments [Hash] Arguments which must match in the selection + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:181 + def selections(arguments: T.unsafe(nil)); end + + # True if this node has a selection on `field_name`. + # If `field_name` is a String, it is treated as a GraphQL-style (camelized) + # field name and used verbatim. If `field_name` is a Symbol, it is + # treated as a Ruby-style (underscored) name and camelized before comparing. + # + # If `arguments:` is provided, each provided key/value will be matched + # against the arguments in the next selection. This method will return false + # if any of the given `arguments:` are not present and matching in the next selection. + # (But, the next selection may contain _more_ than the given arguments.) + # @param field_name [String, Symbol] + # @param arguments [Hash] Arguments which must match in the selection + # @return [Boolean] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:86 + def selects?(field_name, selected_type: T.unsafe(nil), arguments: T.unsafe(nil)); end + + # True if this node has a selection with alias matching `alias_name`. + # If `alias_name` is a String, it is treated as a GraphQL-style (camelized) + # field name and used verbatim. If `alias_name` is a Symbol, it is + # treated as a Ruby-style (underscored) name and camelized before comparing. + # + # If `arguments:` is provided, each provided key/value will be matched + # against the arguments in the next selection. This method will return false + # if any of the given `arguments:` are not present and matching in the next selection. + # (But, the next selection may contain _more_ than the given arguments.) + # @param alias_name [String, Symbol] + # @param arguments [Hash] Arguments which must match in the selection + # @return [Boolean] + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:102 + def selects_alias?(alias_name, arguments: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:356 + def alias_selections; end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:326 + def arguments_match?(arguments, field_defn, field_node); end + + # If a selection on `node` matches `field_name` (which is backed by `field_defn`) + # and matches the `arguments:` constraints, then add that node to `matches` + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:304 + def find_selected_nodes(node, field_name, field_defn, arguments:, matches:, alias_name: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:264 + def find_selections(subselections_by_type, selections_on_type, selected_type, ast_selections, arguments); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:340 + def lookahead_for_selection(field_defn, selected_type, arguments, alias_name = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:361 + def lookup_alias_node(nodes, name); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:380 + def lookup_fragment(ast_selection); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:252 + def skipped_by_directive?(ast_selection); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:369 + def unwrap_fragments(node); end +end + +# A singleton, so that misses don't come with overhead. +# +# pkg:gem/graphql#lib/graphql/execution/lookahead.rb:248 +GraphQL::Execution::Lookahead::NULL_LOOKAHEAD = T.let(T.unsafe(nil), GraphQL::Execution::Lookahead::NullLookahead) + +# This is returned for {Lookahead#selection} when a non-existent field is passed +# +# pkg:gem/graphql#lib/graphql/execution/lookahead.rb:221 +class GraphQL::Execution::Lookahead::NullLookahead < ::GraphQL::Execution::Lookahead + # No inputs required here. + # + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:223 + def initialize; end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:242 + def inspect; end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:226 + def selected?; end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:234 + def selection(*_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:238 + def selections(*_arg0); end + + # pkg:gem/graphql#lib/graphql/execution/lookahead.rb:230 + def selects?(*_arg0); end +end + +# Execute multiple queries under the same multiplex "umbrella". +# They can share a batching context and reduce redundant database hits. +# +# The flow is: +# +# - Multiplex instrumentation setup +# - Query instrumentation setup +# - Analyze the multiplex + each query +# - Begin each query +# - Resolve lazy values, breadth-first across all queries +# - Finish each query (eg, get errors) +# - Query instrumentation teardown +# - Multiplex instrumentation teardown +# +# If one query raises an application error, all queries will be in undefined states. +# +# Validation errors and {GraphQL::ExecutionError}s are handled in isolation: +# one of these errors in one query will not affect the other queries. +# +# @see {Schema#multiplex} for public API +# @api private +# +# pkg:gem/graphql#lib/graphql/execution/multiplex.rb:25 +class GraphQL::Execution::Multiplex + include ::GraphQL::Tracing::Traceable + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:30 + def initialize(schema:, queries:, context:, max_complexity:); end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def context; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def current_trace; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def dataloader; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:42 + def logger; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def max_complexity; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def queries; end + + # pkg:gem/graphql#lib/graphql/execution/multiplex.rb:28 + def schema; end +end + +# pkg:gem/graphql#lib/graphql/execution/next.rb:39 +module GraphQL::Execution::Next + class << self + # pkg:gem/graphql#lib/graphql/execution/next.rb:79 + def run_all(schema, query_options, context: T.unsafe(nil), max_complexity: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:74 + def use(schema, as_default: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/execution/next.rb:40 +module GraphQL::Execution::Next::SchemaExtension + # pkg:gem/graphql#lib/graphql/execution/next.rb:41 + def execute_next(query_str = T.unsafe(nil), query: T.unsafe(nil), subscription_topic: T.unsafe(nil), context: T.unsafe(nil), document: T.unsafe(nil), operation_name: T.unsafe(nil), variables: T.unsafe(nil), warden: T.unsafe(nil), root_value: T.unsafe(nil), validate: T.unsafe(nil), visibility_profile: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/next.rb:69 + def multiplex_next(query_options, context: T.unsafe(nil), max_complexity: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/execution/next.rb:33 +module GraphQL::Execution::PostProcessor + # pkg:gem/graphql#lib/graphql/execution/next.rb:34 + def after_resolve(field_results); end +end + +# pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:4 +class GraphQL::Execution::PrepareObjectStep + # pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:5 + def initialize(object:, runner:, graphql_result:, key:, is_non_null:, field_resolve_step:, next_objects:, next_results:, is_from_array:); end + + # pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:76 + def authorize; end + + # pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:44 + def call; end + + # pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:109 + def create_result; end + + # pkg:gem/graphql#lib/graphql/execution/prepare_object_step.rb:21 + def value; end +end + +# pkg:gem/graphql#lib/graphql/execution/resolve_type_step.rb:4 +class GraphQL::Execution::ResolveTypeStep + class << self + # pkg:gem/graphql#lib/graphql/execution/resolve_type_step.rb:17 + def assert_valid_resolved_type(abstract_type, resolved_type, object, field_resolution_step, query: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/resolve_type_step.rb:5 + def resolve_type(type, object, query); end + end +end + +# pkg:gem/graphql#lib/graphql/execution/runner.rb:4 +class GraphQL::Execution::Runner + # pkg:gem/graphql#lib/graphql/execution/runner.rb:5 + def initialize(multiplex); end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/execution/runner.rb:59 + def add_finalizer(query, result_value, key, finalizer); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:52 + def add_step(step); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def authorizes; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:42 + def authorizes?(graphql_definition, query_context); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def dataloader; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:75 + def execute; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:40 + def finalizer_keys; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def finalizers; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:163 + def gather_selections(type_defn, ast_selections, selections_step, query, all_selections, prototype_result, into:); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def input_values; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:206 + def lazy?(object); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def resolves_lazies; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:40 + def runtime_directives; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def runtime_type_at; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def schema; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def static_type_at; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def steps_queue; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:215 + def type_condition_applies?(context, concrete_type, type_name); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:40 + def uses_runtime_directives; end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:56 + def variables; end + + private + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:228 + def begin_execute(isolated_steps, results, query, root_type, root_value); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:390 + def directives_include?(query, ast_selection); end + + # pkg:gem/graphql#lib/graphql/execution/runner.rb:411 + def run_isolated_scalar(type, partial); end +end + +# pkg:gem/graphql#lib/graphql/execution/selections_step.rb:4 +class GraphQL::Execution::SelectionsStep + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:5 + def initialize(parent_type:, selections:, objects:, results:, runner:, query:, path:, clobber: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:26 + def call; end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:20 + def graphql_objects; end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:18 + def objects; end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:18 + def path; end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:18 + def query; end + + # pkg:gem/graphql#lib/graphql/execution/selections_step.rb:18 + def results; end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/execution.rb:13 +class GraphQL::Execution::Skip < ::GraphQL::RuntimeError + # pkg:gem/graphql#lib/graphql/execution.rb:15 + def ast_nodes=(_ignored); end + + # pkg:gem/graphql#lib/graphql/execution.rb:17 + def finalize_graphql_result(query, result_data, key); end + + # pkg:gem/graphql#lib/graphql/execution.rb:14 + def path; end + + # pkg:gem/graphql#lib/graphql/execution.rb:14 + def path=(_arg0); end +end + +# If a field's resolve function returns a {ExecutionError}, +# the error will be inserted into the response's `"errors"` key +# and the field will resolve to `nil`. +# +# pkg:gem/graphql#lib/graphql/execution_error.rb:6 +class GraphQL::ExecutionError < ::GraphQL::RuntimeError + # pkg:gem/graphql#lib/graphql/execution_error.rb:21 + def initialize(message, ast_node: T.unsafe(nil), ast_nodes: T.unsafe(nil), options: T.unsafe(nil), extensions: T.unsafe(nil)); end + + # @return [Hash] Optional custom data for error objects which will be added + # under the `extensions` key. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:19 + def extensions; end + + # @return [Hash] Optional custom data for error objects which will be added + # under the `extensions` key. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:19 + def extensions=(_arg0); end + + # pkg:gem/graphql#lib/graphql/execution_error.rb:28 + def finalize_graphql_result(query, result_data, key); end + + # @return [Hash] Optional data for error objects + # @deprecated Use `extensions` instead of `options`. The GraphQL spec + # recommends that any custom entries in an error be under the + # `extensions` key. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:15 + def options; end + + # @return [Hash] Optional data for error objects + # @deprecated Use `extensions` instead of `options`. The GraphQL spec + # recommends that any custom entries in an error be under the + # `extensions` key. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:15 + def options=(_arg0); end + + # @return [String] an array describing the JSON-path into the execution + # response which corresponds to this error. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:9 + def path; end + + # @return [String] an array describing the JSON-path into the execution + # response which corresponds to this error. + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:9 + def path=(_arg0); end + + # @return [Hash] An entry for the response's "errors" key + # + # pkg:gem/graphql#lib/graphql/execution_error.rb:38 + def to_h; end +end + +# This error is raised when `Types::Int` is given an input value outside of 32-bit integer range. +# +# For really big integer values, consider `GraphQL::Types::BigInt` +# +# @see GraphQL::Types::Int which raises this error +# +# pkg:gem/graphql#lib/graphql/integer_decoding_error.rb:8 +class GraphQL::IntegerDecodingError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/integer_decoding_error.rb:12 + def initialize(value); end + + # The value which couldn't be decoded + # + # pkg:gem/graphql#lib/graphql/integer_decoding_error.rb:10 + def integer_value; end +end + +# This error is raised when `Types::Int` is asked to return a value outside of 32-bit integer range. +# +# For values outside that range, consider: +# +# - `ID` for database primary keys or other identifiers +# - `GraphQL::Types::BigInt` for really big integer values +# +# @see GraphQL::Types::Int which raises this error +# +# pkg:gem/graphql#lib/graphql/integer_encoding_error.rb:11 +class GraphQL::IntegerEncodingError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/integer_encoding_error.rb:21 + def initialize(value, context:); end + + # @return [GraphQL::Schema::Field] The field that returned a too-big integer + # + # pkg:gem/graphql#lib/graphql/integer_encoding_error.rb:16 + def field; end + + # The value which couldn't be encoded + # + # pkg:gem/graphql#lib/graphql/integer_encoding_error.rb:13 + def integer_value; end + + # @return [Array] Where the field appeared in the GraphQL response + # + # pkg:gem/graphql#lib/graphql/integer_encoding_error.rb:19 + def path; end +end + +# pkg:gem/graphql#lib/graphql/introspection.rb:3 +module GraphQL::Introspection + class << self + # pkg:gem/graphql#lib/graphql/introspection.rb:4 + def query(include_deprecated_args: T.unsafe(nil), include_schema_description: T.unsafe(nil), include_is_repeatable: T.unsafe(nil), include_specified_by_url: T.unsafe(nil), include_is_one_of: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/base_object.rb:4 +class GraphQL::Introspection::BaseObject < ::GraphQL::Schema::Object + extend ::GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + + class << self + # pkg:gem/graphql#lib/graphql/introspection/base_object.rb:7 + def field(*args, **kwargs, &block); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/directive_location_enum.rb:4 +class GraphQL::Introspection::DirectiveLocationEnum < ::GraphQL::Schema::Enum; end + +# pkg:gem/graphql#lib/graphql/introspection/directive_location_enum.rb:4 +class GraphQL::Introspection::DirectiveLocationEnum::UnresolvedValueError < ::GraphQL::Schema::Enum::UnresolvedValueError; end + +# pkg:gem/graphql#lib/graphql/introspection/directive_type.rb:4 +class GraphQL::Introspection::DirectiveType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/directive_type.rb:30 + def args(include_deprecated:); end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/directive_type.rb:24 + def resolve_args(object, context, include_deprecated:); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/dynamic_fields.rb:4 +class GraphQL::Introspection::DynamicFields < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/dynamic_fields.rb:7 + def __typename; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/dynamic_fields.rb:11 + def __typename(object, context); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/entry_points.rb:4 +class GraphQL::Introspection::EntryPoints < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/entry_points.rb:17 + def __schema; end + + # pkg:gem/graphql#lib/graphql/introspection/entry_points.rb:21 + def __type(name:); end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/entry_points.rb:10 + def __schema(context); end + + # pkg:gem/graphql#lib/graphql/introspection/entry_points.rb:25 + def __type(context, name:); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/enum_value_type.rb:4 +class GraphQL::Introspection::EnumValueType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/enum_value_type.rb:18 + def is_deprecated; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/enum_value_type.rb:14 + def resolve_is_deprecated(object, context); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/field_type.rb:4 +class GraphQL::Introspection::FieldType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/field_type.rb:31 + def args(include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/field_type.rb:21 + def is_deprecated; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/field_type.rb:25 + def resolve_args(object, context, include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/field_type.rb:17 + def resolve_is_deprecated(object, _context); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/introspection_query.rb:6 +GraphQL::Introspection::INTROSPECTION_QUERY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:4 +class GraphQL::Introspection::InputValueType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:44 + def default_value; end + + # pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:20 + def is_deprecated; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:24 + def resolve_default_value(object, context); end + + # pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:16 + def resolve_is_deprecated(object, context); end + + # Recursively serialize, taking care not to add quotes to enum values + # + # pkg:gem/graphql#lib/graphql/introspection/input_value_type.rb:52 + def serialize_default_value(value, type, context); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:5 +class GraphQL::Introspection::SchemaType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:45 + def directives; end + + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:37 + def mutation_type; end + + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:33 + def query_type; end + + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:22 + def schema_description; end + + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:41 + def subscription_type; end + + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:26 + def types; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/schema_type.rb:18 + def schema_description(context); end + end +end + +# pkg:gem/graphql#lib/graphql/introspection/type_kind_enum.rb:4 +class GraphQL::Introspection::TypeKindEnum < ::GraphQL::Schema::Enum; end + +# pkg:gem/graphql#lib/graphql/introspection/type_kind_enum.rb:4 +class GraphQL::Introspection::TypeKindEnum::UnresolvedValueError < ::GraphQL::Schema::Enum::UnresolvedValueError; end + +# pkg:gem/graphql#lib/graphql/introspection/type_type.rb:4 +class GraphQL::Introspection::TypeType < ::GraphQL::Introspection::BaseObject + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:77 + def enum_values(include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:131 + def fields(include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:103 + def input_fields(include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:89 + def interfaces; end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:39 + def is_one_of; end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:59 + def kind; end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:139 + def of_type; end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:115 + def possible_types; end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:51 + def specified_by_url; end + + class << self + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:63 + def resolve_enum_values(object, context, include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:119 + def resolve_fields(object, context, include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:93 + def resolve_input_fields(object, context, include_deprecated:); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:81 + def resolve_interfaces(object, context); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:34 + def resolve_is_one_of(object, _ctx); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:55 + def resolve_kind(object, context); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:135 + def resolve_of_type(object, _ctx); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:107 + def resolve_possible_types(object, context); end + + # pkg:gem/graphql#lib/graphql/introspection/type_type.rb:43 + def resolve_specified_by_url(object, _ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/invalid_name_error.rb:3 +class GraphQL::InvalidNameError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/invalid_name_error.rb:5 + def initialize(name, valid_regex); end + + # pkg:gem/graphql#lib/graphql/invalid_name_error.rb:4 + def name; end + + # pkg:gem/graphql#lib/graphql/invalid_name_error.rb:4 + def valid_regex; end +end + +# Raised automatically when a field's resolve function returns `nil` +# for a non-null field. +# +# pkg:gem/graphql#lib/graphql/invalid_null_error.rb:5 +class GraphQL::InvalidNullError < ::GraphQL::RuntimeError + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:24 + def initialize(parent_type, field, ast_node_or_nodes, is_from_array: T.unsafe(nil), path: T.unsafe(nil)); end + + # @return [GraphQL::Language::Nodes::Field] the field where the error occurred + # + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:13 + def ast_node; end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:17 + def ast_nodes; end + + # @return [GraphQL::Field] The field which failed to return a value + # + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:10 + def field; end + + # @return [Boolean] indicates an array result caused the error + # + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:20 + def is_from_array; end + + # @return [GraphQL::BaseType] The owner of {#field} + # + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:7 + def parent_type; end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:22 + def path; end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:22 + def path=(_arg0); end + + class << self + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:50 + def inspect; end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:42 + def parent_class; end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:42 + def parent_class=(_arg0); end + + # pkg:gem/graphql#lib/graphql/invalid_null_error.rb:44 + def subclass_for(parent_class); end + end +end + +# This error is raised when GraphQL-Ruby encounters a situation +# that it *thought* would never happen. Please report this bug! +# +# pkg:gem/graphql#lib/graphql.rb:26 +class GraphQL::InvariantError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql.rb:27 + def initialize(message); end +end + +# pkg:gem/graphql#lib/graphql/language/block_string.rb:3 +module GraphQL::Language + class << self + # pkg:gem/graphql#lib/graphql/language.rb:105 + def add_space_between_numbers_and_names(query_str); end + + # Returns a new string if any single-quoted newlines were escaped. + # Otherwise, returns `query_str` unchanged. + # @return [String] + # + # pkg:gem/graphql#lib/graphql/language.rb:47 + def escape_single_quoted_newlines(query_str); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/language.rb:20 + def serialize(value); end + end +end + +# pkg:gem/graphql#lib/graphql/language/block_string.rb:4 +module GraphQL::Language::BlockString + class << self + # pkg:gem/graphql#lib/graphql/language/block_string.rb:94 + def break_line(line, length); end + + # pkg:gem/graphql#lib/graphql/language/block_string.rb:110 + def contains_only_whitespace?(line); end + + # pkg:gem/graphql#lib/graphql/language/block_string.rb:61 + def print(str, indent: T.unsafe(nil)); end + + # Remove leading and trailing whitespace from a block string. + # See "Block Strings" in https://github.com/facebook/graphql/blob/master/spec/Section%202%20--%20Language.md + # + # pkg:gem/graphql#lib/graphql/language/block_string.rb:7 + def trim_whitespace(str); end + end +end + +# This cache is used by {GraphQL::Language::Parser.parse_file} when it's enabled. +# +# With Rails, parser caching may enabled by setting `config.graphql.parser_cache = true` in your Rails application. +# +# The cache may be manually built by assigning `GraphQL::Language::Parser.cache = GraphQL::Language::Cache.new("some_dir")`. +# This will create a directory (`tmp/cache/graphql` by default) that stores a cache of parsed files. +# +# Much like [bootsnap](https://github.com/Shopify/bootsnap), the parser cache needs to be cleaned up manually. +# You will need to clear the cache directory for each new deployment of your application. +# Also note that the parser cache will grow as your schema is loaded, so the cache directory must be writable. +# +# @see GraphQL::Railtie for simple Rails integration +# +# pkg:gem/graphql#lib/graphql/language/cache.rb:20 +class GraphQL::Language::Cache + # pkg:gem/graphql#lib/graphql/language/cache.rb:21 + def initialize(path); end + + # pkg:gem/graphql#lib/graphql/language/cache.rb:27 + def fetch(filename); end +end + +# pkg:gem/graphql#lib/graphql/language/cache.rb:25 +GraphQL::Language::Cache::DIGEST = T.let(T.unsafe(nil), Digest::SHA256) + +# pkg:gem/graphql#lib/graphql/language/comment.rb:4 +module GraphQL::Language::Comment + class << self + # pkg:gem/graphql#lib/graphql/language/comment.rb:5 + def print(str, indent: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/language/definition_slice.rb:4 +module GraphQL::Language::DefinitionSlice + extend ::GraphQL::Language::DefinitionSlice + + # pkg:gem/graphql#lib/graphql/language/definition_slice.rb:7 + def slice(document, name); end +end + +# pkg:gem/graphql#lib/graphql/language/definition_slice.rb:18 +class GraphQL::Language::DefinitionSlice::DependencyVisitor < ::GraphQL::Language::StaticVisitor + # pkg:gem/graphql#lib/graphql/language/definition_slice.rb:19 + def initialize(doc, definitions, names); end + + # pkg:gem/graphql#lib/graphql/language/definition_slice.rb:25 + def on_fragment_spread(node, parent); end + + class << self + # pkg:gem/graphql#lib/graphql/language/definition_slice.rb:32 + def find_definition_dependencies(definitions, name, names); end + end +end + +# @api private +# +# {GraphQL::Language::DocumentFromSchemaDefinition} is used to convert a {GraphQL::Schema} object +# To a {GraphQL::Language::Document} AST node. +# +# @param context [Hash] +# @param only [<#call(member, ctx)>] +# @param except [<#call(member, ctx)>] +# @param include_introspection_types [Boolean] Whether or not to include introspection types in the AST +# @param include_built_in_scalars [Boolean] Whether or not to include built in scalars in the AST +# @param include_built_in_directives [Boolean] Whether or not to include built in directives in the AST +# +# pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:15 +class GraphQL::Language::DocumentFromSchemaDefinition + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:16 + def initialize(schema, context: T.unsafe(nil), include_introspection_types: T.unsafe(nil), include_built_in_directives: T.unsafe(nil), include_built_in_scalars: T.unsafe(nil), always_include_schema: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:133 + def build_argument_node(argument); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:250 + def build_argument_nodes(arguments); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:198 + def build_default_value(default_value, type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:266 + def build_definition_nodes; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:176 + def build_directive_location_node(location); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:172 + def build_directive_location_nodes(locations); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:162 + def build_directive_node(directive); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:260 + def build_directive_nodes(directives); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:103 + def build_enum_type_node(enum_type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:115 + def build_enum_value_node(enum_value); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:71 + def build_field_node(field); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:325 + def build_field_nodes(fields); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:152 + def build_input_object_node(input_object); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:92 + def build_interface_type_node(interface_type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:53 + def build_object_type_node(object_type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:124 + def build_scalar_type_node(scalar_type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:38 + def build_schema_node; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:231 + def build_type_definition_node(type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:313 + def build_type_definition_nodes(types); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:182 + def build_type_name_node(type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:82 + def build_union_type_node(union_type); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:32 + def document; end + + private + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:383 + def always_include_schema; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:349 + def definition_directives(member, directives_method); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:345 + def directives(member); end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:383 + def include_built_in_directives; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:383 + def include_built_in_scalars; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:383 + def include_introspection_types; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:333 + def include_schema_node?; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:383 + def schema; end + + # pkg:gem/graphql#lib/graphql/language/document_from_schema_definition.rb:339 + def schema_respects_root_name_conventions?(schema); end +end + +# pkg:gem/graphql#lib/graphql/language.rb:93 +GraphQL::Language::EFFICIENT_IGNORE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# Optimized pattern using: +# - Possessive quantifiers (*+, ++) to prevent backtracking in number patterns +# - Atomic group (?>...) for IGNORE to prevent backtracking +# - Single unified number pattern instead of three alternatives +# +# pkg:gem/graphql#lib/graphql/language.rb:92 +GraphQL::Language::EFFICIENT_NUMBER_REGEXP = T.let(T.unsafe(nil), Regexp) + +# Exposes {.generate}, which turns AST nodes back into query strings. +# +# pkg:gem/graphql#lib/graphql/language/generation.rb:5 +module GraphQL::Language::Generation + extend ::GraphQL::Language::Generation + + # Turn an AST node back into a string. + # + # @example Turning a document into a query + # document = GraphQL.parse(query_string) + # GraphQL::Language::Generation.generate(document) + # # => "{ ... }" + # + # @param node [GraphQL::Language::Nodes::AbstractNode] an AST node to recursively stringify + # @param indent [String] Whitespace to add to each printed node + # @param printer [GraphQL::Language::Printer] An optional custom printer for printing AST nodes. Defaults to GraphQL::Language::Printer + # @return [String] Valid GraphQL for `node` + # + # pkg:gem/graphql#lib/graphql/language/generation.rb:19 + def generate(node, indent: T.unsafe(nil), printer: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/language.rb:97 +GraphQL::Language::INVALID_NUMBER_FOLLOWED_BY_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language.rb:86 +GraphQL::Language::LEADING_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:5 +class GraphQL::Language::Lexer + # pkg:gem/graphql#lib/graphql/language/lexer.rb:6 + def initialize(graphql_str, filename: T.unsafe(nil), max_tokens: T.unsafe(nil)); end + + # This produces a unique integer for bytes 2 and 3 of each keyword string + # See https://tenderlovemaking.com/2023/09/02/fast-tokenizers-with-stringscanner.html + # + # pkg:gem/graphql#lib/graphql/language/lexer.rb:258 + def _hash(key); end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:30 + def advance; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:181 + def column_number; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:125 + def debug_token_value(token_name); end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:19 + def finished?; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:23 + def freeze; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:177 + def line_number; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:28 + def pos; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:185 + def raise_parse_error(message, line = T.unsafe(nil), col = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:154 + def string_value; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:119 + def token_value; end + + # pkg:gem/graphql#lib/graphql/language/lexer.rb:28 + def tokens_count; end + + class << self + # Replace any escaped unicode or whitespace with the _actual_ characters + # To avoid allocating more strings, this modifies the string passed into it + # + # pkg:gem/graphql#lib/graphql/language/lexer.rb:339 + def replace_escaped_characters_in_place(raw_string); end + + # This is not used during parsing because the parser + # doesn't actually need tokens. + # + # pkg:gem/graphql#lib/graphql/language/lexer.rb:366 + def tokenize(string); end + end +end + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:292 +GraphQL::Language::Lexer::BLOCK_QUOTE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:296 +GraphQL::Language::Lexer::BLOCK_STRING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:312 +module GraphQL::Language::Lexer::ByteFor; end + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:316 +GraphQL::Language::Lexer::ByteFor::ELLIPSIS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:317 +GraphQL::Language::Lexer::ByteFor::IDENTIFIER = T.let(T.unsafe(nil), Integer) + +# int or float +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:314 +GraphQL::Language::Lexer::ByteFor::NAME = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:313 +GraphQL::Language::Lexer::ByteFor::NUMBER = T.let(T.unsafe(nil), Integer) + +# identifier, *not* a keyword +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:318 +GraphQL::Language::Lexer::ByteFor::PUNCTUATION = T.let(T.unsafe(nil), Integer) + +# identifier or keyword +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:315 +GraphQL::Language::Lexer::ByteFor::STRING = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:190 +GraphQL::Language::Lexer::COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:152 +GraphQL::Language::Lexer::ESCAPED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:293 +GraphQL::Language::Lexer::ESCAPED_QUOTE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:139 +GraphQL::Language::Lexer::ESCAPES = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:140 +GraphQL::Language::Lexer::ESCAPES_REPLACE = T.let(T.unsafe(nil), Hash) + +# Use this array to check, for a given byte that will start a token, +# what kind of token might it start? +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:310 +GraphQL::Language::Lexer::FIRST_BYTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:193 +GraphQL::Language::Lexer::FLOAT_DECIMAL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:194 +GraphQL::Language::Lexer::FLOAT_EXP_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:288 +GraphQL::Language::Lexer::FOUR_DIGIT_UNICODE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:191 +GraphQL::Language::Lexer::IDENTIFIER_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:189 +GraphQL::Language::Lexer::IGNORE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:192 +GraphQL::Language::Lexer::INT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:198 +GraphQL::Language::Lexer::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:221 +GraphQL::Language::Lexer::KEYWORD_BY_TWO_BYTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:220 +GraphQL::Language::Lexer::KEYWORD_REGEXP = T.let(T.unsafe(nil), Regexp) + +# TODO: FLOAT_EXP_REGEXP should not be allowed to follow INT_REGEXP, integers are not allowed to have exponent parts. +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:196 +GraphQL::Language::Lexer::NUMERIC_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:289 +GraphQL::Language::Lexer::N_DIGIT_UNICODE = T.let(T.unsafe(nil), Regexp) + +# A sparse array mapping the bytes for each punctuation +# to a symbol name for that punctuation +# +# pkg:gem/graphql#lib/graphql/language/lexer.rb:280 +GraphQL::Language::Lexer::PUNCTUATION_NAME_FOR_BYTE = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:262 +module GraphQL::Language::Lexer::Punctuation; end + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:275 +GraphQL::Language::Lexer::Punctuation::AMP = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:273 +GraphQL::Language::Lexer::Punctuation::BANG = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:269 +GraphQL::Language::Lexer::Punctuation::COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:271 +GraphQL::Language::Lexer::Punctuation::DIR_SIGN = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:272 +GraphQL::Language::Lexer::Punctuation::EQUALS = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:267 +GraphQL::Language::Lexer::Punctuation::LBRACKET = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:263 +GraphQL::Language::Lexer::Punctuation::LCURLY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:265 +GraphQL::Language::Lexer::Punctuation::LPAREN = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:274 +GraphQL::Language::Lexer::Punctuation::PIPE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:268 +GraphQL::Language::Lexer::Punctuation::RBRACKET = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:264 +GraphQL::Language::Lexer::Punctuation::RCURLY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:266 +GraphQL::Language::Lexer::Punctuation::RPAREN = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:270 +GraphQL::Language::Lexer::Punctuation::VAR_SIGN = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:286 +GraphQL::Language::Lexer::QUOTE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:295 +GraphQL::Language::Lexer::QUOTED_STRING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:294 +GraphQL::Language::Lexer::STRING_CHAR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:291 +GraphQL::Language::Lexer::STRING_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:287 +GraphQL::Language::Lexer::UNICODE_DIGIT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:290 +GraphQL::Language::Lexer::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:150 +GraphQL::Language::Lexer::UTF_8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/lexer.rb:151 +GraphQL::Language::Lexer::VALID_STRING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language.rb:95 +GraphQL::Language::MAYBE_INVALID_NUMBER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:4 +module GraphQL::Language::Nodes; end + +# {AbstractNode} is the base class for all nodes in a GraphQL AST. +# +# It provides some APIs for working with ASTs: +# - `children` returns all AST nodes attached to this one. Used for tree traversal. +# - `scalars` returns all scalar (Ruby) values attached to this one. Used for comparing nodes. +# - `to_query_string` turns an AST node into a GraphQL string +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:12 +class GraphQL::Language::Nodes::AbstractNode + # Value equality + # @return [Boolean] True if `self` is equivalent to `other` + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:50 + def ==(other); end + + # @return [Array] all nodes in the tree below this one + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:60 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:76 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:40 + def col; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:44 + def definition_line; end + + # TODO DRY with `replace_child` + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:126 + def delete_child(previous_child); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:34 + def filename; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:36 + def line; end + + # This creates a copy of `self`, with `new_options` applied. + # @param new_options [Hash] + # @return [AbstractNode] a shallow copy of `self` + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:99 + def merge(new_options); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:80 + def position; end + + # Copy `self`, but modify the copy so that `previous_child` is replaced by `new_child` + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:104 + def replace_child(previous_child, new_child); end + + # @return [Array] Scalar values attached to this node + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:65 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:84 + def to_query_string(printer: T.unsafe(nil)); end + + protected + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:140 + def merge!(new_options); end + + private + + # This might be unnecessary, but its easiest to add it here. + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:70 + def initialize_copy(other); end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:174 + def children_of_type; end + + # Add a default `#visit_method` and `#children_method_name` using the class name + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:151 + def inherited(child_class); end + + private + + # Name accessors which return lists of nodes, + # along with the kind of node they return, if possible. + # - Add a reader for these children + # - Add a persistent update method to add a child + # - Generate a `#children` method + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:185 + def children_methods(children_of_type); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:284 + def generate_initialize; end + + # These methods return a plain Ruby value, not another node + # - Add reader methods + # - Add a `#scalars` method + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:252 + def scalar_methods(*method_names); end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:14 +module GraphQL::Language::Nodes::AbstractNode::DefinitionNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:19 + def initialize(definition_line: T.unsafe(nil), **_rest); end + + # This AST node's {#line} returns the first line, which may be the description. + # @return [Integer] The first line of the definition (not the description) + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:17 + def definition_line; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:24 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:28 + def marshal_load(values); end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:57 +GraphQL::Language::Nodes::AbstractNode::NO_CHILDREN = T.let(T.unsafe(nil), Array) + +# A key-value pair for a field's inputs +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:369 +class GraphQL::Language::Nodes::Argument < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), value: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # @!attribute value + # @return [String, Float, Integer, Boolean, Array, InputObject, VariableIdentifier] The value passed for this key + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:379 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def value; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, value, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:384 +class GraphQL::Language::Nodes::Directive < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), arguments: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def arguments; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_argument(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, arguments, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:392 +class GraphQL::Language::Nodes::DirectiveDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), repeatable: T.unsafe(nil), description: T.unsafe(nil), arguments: T.unsafe(nil), locations: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def arguments; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:393 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def locations; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_argument(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_location(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def repeatable; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, repeatable, description, arguments, locations, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:389 +class GraphQL::Language::Nodes::DirectiveLocation < ::GraphQL::Language::Nodes::NameOnlyNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# This is the AST root for normal queries +# +# @example Deriving a document by parsing a string +# document = GraphQL.parse(query_string) +# +# @example Creating a string from a document +# document.to_query_string +# # { ... } +# +# @example Creating a custom string from a document +# class VariableScrubber < GraphQL::Language::Printer +# def print_argument(arg) +# print_string("#{arg.name}: ") +# end +# end +# +# document.to_query_string(printer: VariableScrubber.new) +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:616 +class GraphQL::Language::Nodes::Document < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(definitions: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def definitions; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # @!attribute definitions + # @return [Array] top-level GraphQL units: operations or fragments + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:622 + def slice_definition(name); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, definitions, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# An enum value. The string is available as {#name}. +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:403 +class GraphQL::Language::Nodes::Enum < ::GraphQL::Language::Nodes::NameOnlyNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:765 +class GraphQL::Language::Nodes::EnumTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), values: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:766 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:766 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_value(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def values; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, description, directives, values, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:775 +class GraphQL::Language::Nodes::EnumTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), directives: T.unsafe(nil), values: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_value(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def values; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, directives, values, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:756 +class GraphQL::Language::Nodes::EnumValueDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:757 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:757 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, description, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A single selection in a GraphQL query. +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:411 +class GraphQL::Language::Nodes::Field < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:412 + def initialize(name: T.unsafe(nil), arguments: T.unsafe(nil), directives: T.unsafe(nil), selections: T.unsafe(nil), field_alias: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def alias; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def arguments; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:430 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:434 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_argument(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_selection(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def selections; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:426 + def from_a(filename, line, col, field_alias, name, arguments, directives, selections); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:678 +class GraphQL::Language::Nodes::FieldDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), type: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), arguments: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def arguments; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:679 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:679 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # this is so that `children_method_name` of `InputValueDefinition` works properly + # with `#replace_child` + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:689 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:690 + def merge(new_options); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_argument(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, type, description, arguments, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A reusable fragment, defined at document-level. +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:450 +class GraphQL::Language::Nodes::FragmentDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:451 + def initialize(name: T.unsafe(nil), type: T.unsafe(nil), directives: T.unsafe(nil), selections: T.unsafe(nil), filename: T.unsafe(nil), pos: T.unsafe(nil), source: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:467 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:471 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_selection(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def selections; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:463 + def from_a(filename, line, col, name, type, directives, selections); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# Application of a named fragment in a selection +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:485 +class GraphQL::Language::Nodes::FragmentSpread < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# An unnamed fragment, defined directly in the query with `... { }` +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:496 +class GraphQL::Language::Nodes::InlineFragment < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(type: T.unsafe(nil), directives: T.unsafe(nil), selections: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_selection(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def selections; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, type, directives, selections, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A collection of key-value inputs which may be a field argument +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:510 +class GraphQL::Language::Nodes::InputObject < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(arguments: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def arguments; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_argument(**node_opts); end + + # @return [Hash] Recursively turn this input object into a Ruby Hash + # + # pkg:gem/graphql#lib/graphql/language/nodes.rb:518 + def to_h(options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + private + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:530 + def serialize_value_for_hash(value); end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, arguments, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:784 +class GraphQL::Language::Nodes::InputObjectTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:785 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:785 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, description, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:794 +class GraphQL::Language::Nodes::InputObjectTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:669 +class GraphQL::Language::Nodes::InputValueDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), type: T.unsafe(nil), default_value: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:670 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def default_value; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:670 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, type, default_value, description, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:717 +class GraphQL::Language::Nodes::InterfaceTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), interfaces: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:718 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:718 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def interfaces; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_interface(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, description, interfaces, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:728 +class GraphQL::Language::Nodes::InterfaceTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), interfaces: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def interfaces; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_interface(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, interfaces, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A list type definition, denoted with `[...]` (used for variable type definitions) +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:549 +class GraphQL::Language::Nodes::ListType < ::GraphQL::Language::Nodes::WrapperType + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:5 +GraphQL::Language::Nodes::NONE = T.let(T.unsafe(nil), Array) + +# Base class for nodes whose only value is a name (no child nodes or other scalars) +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:363 +class GraphQL::Language::Nodes::NameOnlyNode < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A non-null type definition, denoted with `...!` (used for variable type definitions) +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:553 +class GraphQL::Language::Nodes::NonNullType < ::GraphQL::Language::Nodes::WrapperType + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A null value literal. +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:407 +class GraphQL::Language::Nodes::NullValue < ::GraphQL::Language::Nodes::NameOnlyNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:698 +class GraphQL::Language::Nodes::ObjectTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), interfaces: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:699 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:699 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def interfaces; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, interfaces, description, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:708 +class GraphQL::Language::Nodes::ObjectTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), interfaces: T.unsafe(nil), directives: T.unsafe(nil), fields: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def fields; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def interfaces; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_field(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, interfaces, directives, fields, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A query, mutation or subscription. +# May be anonymous or named. +# May be explicitly typed (eg `mutation { ... }`) or implicitly a query (eg `{ ... }`). +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:575 +class GraphQL::Language::Nodes::OperationDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(operation_type: T.unsafe(nil), name: T.unsafe(nil), variables: T.unsafe(nil), directives: T.unsafe(nil), selections: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:220 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_selection(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_variable(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def operation_type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def selections; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def variables; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, operation_type, name, variables, directives, selections, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:652 +class GraphQL::Language::Nodes::ScalarTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:653 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:653 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, description, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:661 +class GraphQL::Language::Nodes::ScalarTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:636 +class GraphQL::Language::Nodes::SchemaDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(query: T.unsafe(nil), mutation: T.unsafe(nil), subscription: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def mutation; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def query; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def subscription; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, query, mutation, subscription, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:644 +class GraphQL::Language::Nodes::SchemaExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(query: T.unsafe(nil), mutation: T.unsafe(nil), subscription: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def mutation; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def query; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def subscription; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, query, mutation, subscription, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# A type name, used for variable definitions +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:628 +class GraphQL::Language::Nodes::TypeName < ::GraphQL::Language::Nodes::NameOnlyNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:738 +class GraphQL::Language::Nodes::UnionTypeDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), types: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:739 + def comment; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:739 + def description; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:739 + def types; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, types, description, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/nodes.rb:747 +class GraphQL::Language::Nodes::UnionTypeExtension < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), types: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:748 + def types; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, types, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# An operation-level query variable +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:557 +class GraphQL::Language::Nodes::VariableDefinition < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(name: T.unsafe(nil), type: T.unsafe(nil), default_value: T.unsafe(nil), directives: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil), definition_pos: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:216 + def children; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def default_value; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:198 + def directives; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:205 + def merge_directive(**node_opts); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, name, type, default_value, directives, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# Usage of a variable in a query. Name does _not_ include `$`. +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:632 +class GraphQL::Language::Nodes::VariableIdentifier < ::GraphQL::Language::Nodes::NameOnlyNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# Base class for non-null type names and list type names +# +# pkg:gem/graphql#lib/graphql/language/nodes.rb:357 +class GraphQL::Language::Nodes::WrapperType < ::GraphQL::Language::Nodes::AbstractNode + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def initialize(of_type: T.unsafe(nil), line: T.unsafe(nil), col: T.unsafe(nil), pos: T.unsafe(nil), filename: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_dump; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def marshal_load(values); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def of_type; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:263 + def scalars; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + + class << self + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name; end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def children_method_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:324 + def from_a(filename, line, col, of_type, comment: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/nodes.rb:158 + def visit_method; end + end +end + +# pkg:gem/graphql#lib/graphql/language/parser.rb:9 +class GraphQL::Language::Parser + include ::GraphQL::Language::Nodes + include ::GraphQL::EmptyObjects + + # pkg:gem/graphql#lib/graphql/language/parser.rb:31 + def initialize(graphql_str, filename: T.unsafe(nil), trace: T.unsafe(nil), max_tokens: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:67 + def column_at(pos); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:58 + def line_at(pos); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:43 + def parse; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:53 + def tokens_count; end + + private + + # pkg:gem/graphql#lib/graphql/language/parser.rb:97 + def advance_token; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:803 + def at?(expected_token_name); end + + # token_value works for when the scanner matched something + # which is usually fine and it's good for it to be fast at that. + # + # pkg:gem/graphql#lib/graphql/language/parser.rb:842 + def debug_token_value; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:120 + def definition; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:105 + def document; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:814 + def expect_one_of(token_names); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:807 + def expect_token(expected_token_name); end + + # Only use when we care about the expected token's value + # + # pkg:gem/graphql#lib/graphql/language/parser.rb:831 + def expect_token_value(tok); end + + # @return [Array] Positions of each line break in the original string + # + # pkg:gem/graphql#lib/graphql/language/parser.rb:80 + def lines_at; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:508 + def list_type; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:460 + def parse_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:681 + def parse_arguments; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:664 + def parse_directives; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:385 + def parse_enum_value_definitions; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:441 + def parse_field_definitions; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:426 + def parse_implements; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:371 + def parse_input_object_field_definitions; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:474 + def parse_input_value_definition; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:586 + def parse_name; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:652 + def parse_name_without_on; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:521 + def parse_operation_type; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:660 + def parse_type_name; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:409 + def parse_union_members; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:101 + def pos; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:818 + def raise_parse_error(message); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:535 + def selection_set; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:701 + def string_value; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:95 + def token_name; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:491 + def type; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:707 + def value; end + + class << self + # pkg:gem/graphql#lib/graphql/language/parser.rb:14 + def cache; end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:14 + def cache=(_arg0); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:16 + def parse(graphql_str, filename: T.unsafe(nil), trace: T.unsafe(nil), max_tokens: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/parser.rb:20 + def parse_file(filename, trace: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/language/parser.rb:845 +class GraphQL::Language::Parser::SchemaParser < ::GraphQL::Language::Parser + # pkg:gem/graphql#lib/graphql/language/parser.rb:846 + def initialize(*args, **kwargs); end +end + +# pkg:gem/graphql#lib/graphql/language/printer.rb:4 +class GraphQL::Language::Printer + # Turn an arbitrary AST node back into a string. + # + # @example Turning a document into a query string + # document = GraphQL.parse(query_string) + # GraphQL::Language::Printer.new.print(document) + # # => "{ ... }" + # + # + # @example Building a custom printer + # + # class MyPrinter < GraphQL::Language::Printer + # def print_argument(arg) + # print_string("#{arg.name}: ") + # end + # end + # + # MyPrinter.new.print(document) + # # => "mutation { pay(creditCard: ) { success } }" + # + # @param node [Nodes::AbstractNode] + # @param indent [String] Whitespace to add to the printed node + # @param truncate_size [Integer, nil] The size to truncate to. + # @return [String] Valid GraphQL for `node` + # + # pkg:gem/graphql#lib/graphql/language/printer.rb:54 + def print(node, indent: T.unsafe(nil), truncate_size: T.unsafe(nil)); end + + protected + + # pkg:gem/graphql#lib/graphql/language/printer.rb:76 + def print_argument(argument); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:296 + def print_arguments(arguments, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:430 + def print_comment(node, indent: T.unsafe(nil), first_in_block: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:423 + def print_description(node, indent: T.unsafe(nil), first_in_block: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:437 + def print_description_and_comment(node); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:91 + def print_directive(directive); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:399 + def print_directive_definition(directive); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:458 + def print_directives(directives); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:69 + def print_document(document); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:105 + def print_enum(enum); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:358 + def print_enum_type_definition(enum_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:374 + def print_enum_value_definition(enum_value); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:113 + def print_field(field, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:321 + def print_field_definition(field); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:442 + def print_field_definitions(fields); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:132 + def print_fragment_definition(fragment_def, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:148 + def print_fragment_spread(fragment_spread, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:273 + def print_implements(type); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:155 + def print_inline_fragment(inline_fragment, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:82 + def print_input_object(input_object); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:381 + def print_input_object_type_definition(input_object_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:285 + def print_input_value_definition(input_value); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:331 + def print_interface_type_definition(interface_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:166 + def print_list_type(list_type); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:479 + def print_node(node, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:172 + def print_non_null_type(non_null_type); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:109 + def print_null_value; end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:264 + def print_object_type_definition(object_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:177 + def print_operation_definition(operation_definition, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:257 + def print_scalar_type_definition(scalar_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:222 + def print_schema_definition(schema, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:467 + def print_selections(selections, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:65 + def print_string(str); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:198 + def print_type_name(type_name); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:340 + def print_union_type_definition(union_type, extension: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:202 + def print_variable_definition(variable_definition); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:217 + def print_variable_identifier(variable_identifier); end +end + +# pkg:gem/graphql#lib/graphql/language/printer.rb:5 +GraphQL::Language::Printer::OMISSION = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/language/printer.rb:7 +class GraphQL::Language::Printer::TruncatableBuffer + # pkg:gem/graphql#lib/graphql/language/printer.rb:12 + def initialize(truncate_size: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:17 + def append(other); end + + # pkg:gem/graphql#lib/graphql/language/printer.rb:26 + def to_string; end +end + +# pkg:gem/graphql#lib/graphql/language/printer.rb:10 +GraphQL::Language::Printer::TruncatableBuffer::DEFAULT_INIT_CAPACITY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/language/printer.rb:8 +class GraphQL::Language::Printer::TruncatableBuffer::TruncateSizeReached < ::StandardError; end + +# A custom printer used to print sanitized queries. It inlines provided variables +# within the query for facilitate logging and analysis of queries. +# +# The printer returns `nil` if the query is invalid. +# +# Since the GraphQL Ruby AST for a GraphQL query doesnt contain any reference +# on the type of fields or arguments, we have to track the current object, field +# and input type while printing the query. +# +# @example Printing a scrubbed string +# printer = QueryPrinter.new(query) +# puts printer.sanitized_query_string +# +# @see {Query#sanitized_query_string} +# +# pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:18 +class GraphQL::Language::SanitizedPrinter < ::GraphQL::Language::Printer + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:22 + def initialize(query, inline_variables: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:99 + def coerce_argument_value_to_list?(type, value); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:75 + def print_argument(argument); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:144 + def print_directive(directive); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:115 + def print_field(field, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:135 + def print_fragment_definition(fragment_def, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:123 + def print_inline_fragment(inline_fragment, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:39 + def print_node(node, indent: T.unsafe(nil)); end + + # Print the operation definition but do not include the variable + # definitions since we will inline them within the query + # + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:154 + def print_operation_definition(operation_definition, indent: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:106 + def print_variable_identifier(variable_id); end + + # Indicates whether or not to redact non-null values for the given argument. Defaults to redacting all strings + # arguments but this can be customized by subclasses. + # + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:63 + def redact_argument_value?(argument, value); end + + # Returns the value to use for redacted versions of the given argument. Defaults to the + # string "". + # + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:71 + def redacted_argument_value(argument); end + + # @return [String, nil] A scrubbed query string, if the query was valid. + # + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:31 + def sanitized_query_string; end + + private + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:217 + def query; end + + # pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:172 + def value_to_ast(value, type); end +end + +# pkg:gem/graphql#lib/graphql/language/sanitized_printer.rb:20 +GraphQL::Language::SanitizedPrinter::REDACTED = T.let(T.unsafe(nil), String) + +# Like `GraphQL::Language::Visitor` except it doesn't support +# making changes to the document -- only visiting it as-is. +# +# pkg:gem/graphql#lib/graphql/language/static_visitor.rb:6 +class GraphQL::Language::StaticVisitor + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:7 + def initialize(document); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:76 + def on_argument_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_directive_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_directive_location(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:25 + def on_document_children(document_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_enum(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_enum_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_enum_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_enum_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:32 + def on_field_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_field_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:61 + def on_fragment_definition_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:66 + def on_inline_fragment_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_input_object(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_input_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_input_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_input_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_interface_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_interface_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_list_type(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_non_null_type(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_null_value(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_operation_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:68 + def on_operation_definition_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_scalar_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_scalar_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_schema_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_schema_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_type_name(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_union_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_union_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_variable_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:101 + def on_variable_identifier(node, parent); end + + # Visit `document` and all children + # @return [void] + # + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:13 + def visit; end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:40 + def visit_directives(new_node); end + + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:46 + def visit_selections(new_node); end + + class << self + # We don't use `alias` here because it breaks `super` + # + # pkg:gem/graphql#lib/graphql/language/static_visitor.rb:96 + def make_visit_methods(ast_node_class); end + end +end + +# Depth-first traversal through the tree, calling hooks at each stop. +# +# @example Create a visitor counting certain field names +# class NameCounter < GraphQL::Language::Visitor +# def initialize(document, field_name) +# super(document) +# @field_name = field_name +# @count = 0 +# end +# +# attr_reader :count +# +# def on_field(node, parent) +# # if this field matches our search, increment the counter +# if node.name == @field_name +# @count += 1 +# end +# # Continue visiting subfields: +# super +# end +# end +# +# # Initialize a visitor +# visitor = NameCounter.new(document, "name") +# # Run it +# visitor.visit +# # Check the result +# visitor.count +# # => 3 +# +# @see GraphQL::Language::StaticVisitor for a faster visitor that doesn't support modifying the document +# +# pkg:gem/graphql#lib/graphql/language/visitor.rb:35 +class GraphQL::Language::Visitor + # pkg:gem/graphql#lib/graphql/language/visitor.rb:42 + def initialize(document); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:142 + def on_argument_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_argument_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive_location(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive_location_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_directive_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:64 + def on_document_children(document_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_document_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_value_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_enum_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:77 + def on_field_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_field_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_field_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_field_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:121 + def on_fragment_definition_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_fragment_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_fragment_spread_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:127 + def on_inline_fragment_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_inline_fragment_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_object_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_input_value_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_interface_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_interface_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_interface_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_interface_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_list_type(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_list_type_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_non_null_type(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_non_null_type_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_null_value(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_null_value_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_object_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_object_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_operation_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:129 + def on_operation_definition_children(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_operation_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_scalar_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_scalar_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_scalar_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_scalar_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_schema_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_schema_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_schema_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_schema_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_type_name(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_type_name_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_union_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_union_type_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_union_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_union_type_extension_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_variable_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_variable_definition_with_modifications(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_variable_identifier(node, parent); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:172 + def on_variable_identifier_with_modifications(node, parent); end + + # @return [GraphQL::Language::Nodes::Document] The document with any modifications applied + # + # pkg:gem/graphql#lib/graphql/language/visitor.rb:48 + def result; end + + # Visit `document` and all children + # @return [void] + # + # pkg:gem/graphql#lib/graphql/language/visitor.rb:52 + def visit; end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:90 + def visit_directives(new_node); end + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:101 + def visit_selections(new_node); end + + private + + # pkg:gem/graphql#lib/graphql/language/visitor.rb:265 + def apply_modifications(node, parent, new_node_and_new_parent); end + + class << self + # We don't use `alias` here because it breaks `super` + # + # pkg:gem/graphql#lib/graphql/language/visitor.rb:167 + def make_visit_methods(ast_node_class); end + end +end + +# When this is returned from a visitor method, +# Then the `node` passed into the method is removed from `parent`'s children. +# +# pkg:gem/graphql#lib/graphql/language/visitor.rb:40 +GraphQL::Language::Visitor::DELETE_NODE = T.let(T.unsafe(nil), GraphQL::Language::Visitor::DeleteNode) + +# pkg:gem/graphql#lib/graphql/language/visitor.rb:36 +class GraphQL::Language::Visitor::DeleteNode; end + +# Raised when a argument is configured with `loads:` and the client provides an `ID`, +# but no object is loaded for that ID. +# +# @see GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader#load_application_object_failed, A hook which you can override in resolvers, mutations and input objects. +# +# pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:8 +class GraphQL::LoadApplicationObjectFailedError < ::GraphQL::ExecutionError + # pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:18 + def initialize(argument:, id:, object:, context:); end + + # @return [GraphQL::Schema::Argument] the argument definition for the argument that was looked up + # + # pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:10 + def argument; end + + # @return [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:16 + def context; end + + # @return [String] The ID provided by the client + # + # pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:12 + def id; end + + # @return [Object] The value found with this ID + # + # pkg:gem/graphql#lib/graphql/load_application_object_failed_error.rb:14 + def object; end +end + +# pkg:gem/graphql#lib/graphql.rb:75 +GraphQL::NOT_CONFIGURED = T.let(T.unsafe(nil), Object) + +# pkg:gem/graphql#lib/graphql/name_validator.rb:3 +class GraphQL::NameValidator + class << self + # pkg:gem/graphql#lib/graphql/name_validator.rb:6 + def validate!(name); end + end +end + +# pkg:gem/graphql#lib/graphql/name_validator.rb:4 +GraphQL::NameValidator::VALID_NAME_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/pagination/connection.rb:4 +module GraphQL::Pagination; end + +# Customizes `RelationConnection` to work with `ActiveRecord::Relation`s. +# +# pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:7 +class GraphQL::Pagination::ActiveRecordRelationConnection < ::GraphQL::Pagination::RelationConnection + private + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:72 + def already_loaded?(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:43 + def null_relation(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:10 + def relation_count(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:27 + def relation_limit(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:35 + def relation_offset(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:52 + def set_limit(nodes, limit); end + + # pkg:gem/graphql#lib/graphql/pagination/active_record_relation_connection.rb:60 + def set_offset(nodes, offset); end +end + +# pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:6 +class GraphQL::Pagination::ArrayConnection < ::GraphQL::Pagination::Connection + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:22 + def cursor_for(item); end + + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:17 + def has_next_page; end + + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:12 + def has_previous_page; end + + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:7 + def nodes; end + + private + + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:29 + def index_from_cursor(cursor); end + + # Populate all the pagination info _once_, + # It doesn't do anything on subsequent calls. + # + # pkg:gem/graphql#lib/graphql/pagination/array_connection.rb:35 + def load_nodes; end +end + +# A Connection wraps a list of items and provides cursor-based pagination over it. +# +# Connections were introduced by Facebook's `Relay` front-end framework, but +# proved to be generally useful for GraphQL APIs. When in doubt, use connections +# to serve lists (like Arrays, ActiveRecord::Relations) via GraphQL. +# +# Unlike the previous connection implementation, these default to bidirectional pagination. +# +# Pagination arguments and context may be provided at initialization or assigned later (see {Schema::Field::ConnectionExtension}). +# +# pkg:gem/graphql#lib/graphql/pagination/connection.rb:14 +class GraphQL::Pagination::Connection + # @param items [Object] some unpaginated collection item, like an `Array` or `ActiveRecord::Relation` + # @param context [Query::Context] + # @param parent [Object] The object this collection belongs to + # @param first [Integer, nil] The limit parameter from the client, if it provided one + # @param after [String, nil] A cursor for pagination, if the client provided one + # @param last [Integer, nil] Limit parameter from the client, if provided + # @param before [String, nil] A cursor for pagination, if the client provided one. + # @param arguments [Hash] The arguments to the field that returned the collection wrapped by this connection + # @param max_page_size [Integer, nil] A configured value to cap the result size. Applied as `first` if neither first or last are given and no `default_page_size` is set. + # @param default_page_size [Integer, nil] A configured value to determine the result size when neither first or last are given. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:69 + def initialize(items, parent: T.unsafe(nil), field: T.unsafe(nil), context: T.unsafe(nil), first: T.unsafe(nil), after: T.unsafe(nil), max_page_size: T.unsafe(nil), default_page_size: T.unsafe(nil), last: T.unsafe(nil), before: T.unsafe(nil), edge_class: T.unsafe(nil), arguments: T.unsafe(nil)); end + + # @return [String, nil] the client-provided cursor. `""` is treated as `nil`. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:48 + def after; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def after_value; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def after_value=(_arg0); end + + # @return [Hash Object>] The field arguments from the field that returned this connection + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:57 + def arguments; end + + # @return [Hash Object>] The field arguments from the field that returned this connection + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:57 + def arguments=(_arg0); end + + # @return [String, nil] the client-provided cursor. `""` is treated as `nil`. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:39 + def before; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def before_value; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def before_value=(_arg0); end + + # @return [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:22 + def context; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:24 + def context=(new_ctx); end + + # Return a cursor for this item. + # @param item [Object] one of the passed in {items}, taken from {nodes} + # @return [String] + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:220 + def cursor_for(item); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:125 + def default_page_size; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:120 + def default_page_size=(new_value); end + + # @return [Class] A wrapper class for edges of this connection + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:176 + def edge_class; end + + # @return [Class] A wrapper class for edges of this connection + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:176 + def edge_class=(_arg0); end + + # A dynamic alias for compatibility with {Relay::BaseConnection}. + # @deprecated use {#nodes} instead + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:188 + def edge_nodes; end + + # @return [Array] {nodes}, but wrapped with Edge instances + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:171 + def edges; end + + # @return [String] The cursor of the last item in {nodes} + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:213 + def end_cursor; end + + # @return [GraphQL::Schema::Field] The field this connection was returned by + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:179 + def field; end + + # @return [GraphQL::Schema::Field] The field this connection was returned by + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:179 + def field=(_arg0); end + + # @return [Integer, nil] + # A clamped `first` value. + # (The underlying instance variable doesn't have limits on it.) + # If neither `first` nor `last` is given, but `default_page_size` is + # present, default_page_size is used for first. If `default_page_size` + # is greater than `max_page_size``, it'll be clamped down to + # `max_page_size`. If `default_page_size` is nil, use `max_page_size`. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:145 + def first; end + + # @return [Integer, nil] + # A clamped `first` value. + # (The underlying instance variable doesn't have limits on it.) + # If neither `first` nor `last` is given, but `default_page_size` is + # present, default_page_size is used for first. If `default_page_size` + # is greater than `max_page_size``, it'll be clamped down to + # `max_page_size`. If `default_page_size` is nil, use `max_page_size`. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:137 + def first=(_arg0); end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def first_value; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def first_value=(_arg0); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:133 + def has_default_page_size_override?; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:116 + def has_max_page_size_override?; end + + # @return [Boolean] True if there are more items after this page + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:198 + def has_next_page; end + + # @return [Boolean] True if there were items before these items + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:203 + def has_previous_page; end + + # @return [Object] A list object, from the application. This is the unpaginated value passed into the connection. + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:19 + def items; end + + # @return [Integer, nil] A clamped `last` value. (The underlying instance variable doesn't have limits on it) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:166 + def last; end + + # @return [Integer, nil] A clamped `last` value. (The underlying instance variable doesn't have limits on it) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:164 + def last=(_arg0); end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def last_value; end + + # Raw access to client-provided values. (`max_page_size` not applied to first or last.) + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:36 + def last_value=(_arg0); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:108 + def max_page_size; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:103 + def max_page_size=(new_value); end + + # @return [Array] A slice of {items}, constrained by {@first_value}/{@after_value}/{@last_value}/{@before_value} + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:182 + def nodes; end + + # The connection object itself implements `PageInfo` fields + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:193 + def page_info; end + + # @return [Object] the object this collection belongs to + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:33 + def parent; end + + # @return [Object] the object this collection belongs to + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:33 + def parent=(_arg0); end + + # This is called by `Relay::RangeAdd` -- it can be overridden + # when `item` needs some modifications based on this connection's state. + # + # @param item [Object] An item newly added to `items` + # @return [Edge] + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:160 + def range_add_edge(item); end + + # @return [String] The cursor of the first item in {nodes} + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:208 + def start_cursor; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:97 + def was_authorized_by_scope_items=(_arg0); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:99 + def was_authorized_by_scope_items?; end + + private + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:250 + def decode(cursor); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:226 + def detect_was_authorized_by_scope_items; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:254 + def encode(cursor); end + + # @param argument [nil, Integer] `first` or `last`, as provided by the client + # @param max_page_size [nil, Integer] + # @return [nil, Integer] `nil` if the input was `nil`, otherwise a value between `0` and `max_page_size` + # + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:239 + def limit_pagination_argument(argument, max_page_size); end +end + +# A wrapper around paginated items. It includes a {cursor} for pagination +# and could be extended with custom relationship-level data. +# +# pkg:gem/graphql#lib/graphql/pagination/connection.rb:260 +class GraphQL::Pagination::Connection::Edge + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:263 + def initialize(node, connection); end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:272 + def cursor; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:261 + def node; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:268 + def parent; end + + # pkg:gem/graphql#lib/graphql/pagination/connection.rb:276 + def was_authorized_by_scope_items?; end +end + +# pkg:gem/graphql#lib/graphql/pagination/connection.rb:15 +class GraphQL::Pagination::Connection::PaginationImplementationMissingError < ::GraphQL::Error; end + +# A schema-level connection wrapper manager. +# +# Attach as a plugin. +# +# @example Adding a custom wrapper +# class MySchema < GraphQL::Schema +# connections.add(MyApp::SearchResults, MyApp::SearchResultsConnection) +# end +# +# @example Removing default connection support for arrays (they can still be manually wrapped) +# class MySchema < GraphQL::Schema +# connections.delete(Array) +# end +# +# @see {Schema.connections} +# +# pkg:gem/graphql#lib/graphql/pagination/connections.rb:20 +class GraphQL::Pagination::Connections + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:24 + def initialize(schema:); end + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:30 + def add(nodes_class, implementation); end + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:38 + def all_wrappers; end + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:34 + def delete(nodes_class); end + + # use an override if there is one + # @api private + # + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:118 + def edge_class_for_field(field); end + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:86 + def populate_connection(field, object, value, original_arguments, context); end + + # Used by the runtime to wrap values in connection wrappers. + # @api Private + # + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:61 + def wrap(field, parent, items, arguments, context); end + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:48 + def wrapper_for(items, wrappers: T.unsafe(nil)); end + + protected + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:129 + def wrappers; end + + private + + # pkg:gem/graphql#lib/graphql/pagination/connections.rb:133 + def add_default; end +end + +# pkg:gem/graphql#lib/graphql/pagination/connections.rb:21 +class GraphQL::Pagination::Connections::ImplementationMissingError < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/pagination/mongoid_relation_connection.rb:6 +class GraphQL::Pagination::MongoidRelationConnection < ::GraphQL::Pagination::RelationConnection + # pkg:gem/graphql#lib/graphql/pagination/mongoid_relation_connection.rb:19 + def null_relation(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/mongoid_relation_connection.rb:15 + def relation_count(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/mongoid_relation_connection.rb:11 + def relation_limit(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/mongoid_relation_connection.rb:7 + def relation_offset(relation); end +end + +# A generic class for working with database query objects. +# +# pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:7 +class GraphQL::Pagination::RelationConnection < ::GraphQL::Pagination::Connection + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:47 + def cursor_for(item); end + + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:30 + def has_next_page; end + + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:13 + def has_previous_page; end + + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:8 + def nodes; end + + private + + # @return [Integer, nil] + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:174 + def after_offset; end + + # @return [Integer, nil] + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:169 + def before_offset; end + + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:115 + def calculate_sliced_nodes_parameters; end + + # Apply `first` and `last` to `sliced_nodes`, + # returning a new relation + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:180 + def limited_nodes; end + + # Load nodes after applying first/last/before/after, + # returns an array of nodes + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:222 + def load_nodes; end + + # @param relation [Object] A database query object + # @return [Object] A modified query object which will return no records + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:84 + def null_relation(relation); end + + # @return [Integer] + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:89 + def offset_from_cursor(cursor); end + + # @param relation [Object] A database query object + # @return [Integer, nil] The number of items in this relation (hopefully determined without loading all records into memory!) + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:78 + def relation_count(relation); end + + # @param relation [Object] A database query object + # @param _initial_offset [Integer] The number of items already excluded from the relation + # @param size [Integer] The value against which we check the relation size + # @return [Boolean] True if the number of items in this relation is larger than `size` + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:60 + def relation_larger_than(relation, _initial_offset, size); end + + # @param relation [Object] A database query object + # @return [Integer, nil] The limit value, or nil if there isn't one + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:72 + def relation_limit(relation); end + + # @param relation [Object] A database query object + # @return [Integer, nil] The offset value, or nil if there isn't one + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:66 + def relation_offset(relation); end + + # Abstract this operation so we can always ignore inputs less than zero. + # (Sequel doesn't like it, understandably.) + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:105 + def set_limit(relation, limit_value); end + + # Abstract this operation so we can always ignore inputs less than zero. + # (Sequel doesn't like it, understandably.) + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:95 + def set_offset(relation, offset_value); end + + # Apply `before` and `after` to the underlying `items`, + # returning a new relation. + # + # pkg:gem/graphql#lib/graphql/pagination/relation_connection.rb:147 + def sliced_nodes; end +end + +# Customizes `RelationConnection` to work with `Sequel::Dataset`s. +# +# pkg:gem/graphql#lib/graphql/pagination/sequel_dataset_connection.rb:7 +class GraphQL::Pagination::SequelDatasetConnection < ::GraphQL::Pagination::RelationConnection + private + + # pkg:gem/graphql#lib/graphql/pagination/sequel_dataset_connection.rb:23 + def null_relation(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/sequel_dataset_connection.rb:18 + def relation_count(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/sequel_dataset_connection.rb:14 + def relation_limit(relation); end + + # pkg:gem/graphql#lib/graphql/pagination/sequel_dataset_connection.rb:10 + def relation_offset(relation); end +end + +# pkg:gem/graphql#lib/graphql/parse_error.rb:3 +class GraphQL::ParseError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/parse_error.rb:5 + def initialize(message, line, col, query, filename: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/parse_error.rb:4 + def col; end + + # pkg:gem/graphql#lib/graphql/parse_error.rb:4 + def line; end + + # pkg:gem/graphql#lib/graphql/parse_error.rb:4 + def query; end + + # pkg:gem/graphql#lib/graphql/parse_error.rb:16 + def to_h; end +end + +# A combination of query string and {Schema} instance which can be reduced to a {#result}. +# +# pkg:gem/graphql#lib/graphql/query.rb:5 +class GraphQL::Query + include ::GraphQL::Tracing::Traceable + include ::GraphQL::Query::Runnable + extend ::GraphQL::Autoload + extend ::Forwardable + + # Prepare query `query_string` on `schema` + # @param schema [GraphQL::Schema] + # @param query_string [String] + # @param context [#[]] an arbitrary hash of values which you can access in {GraphQL::Field#resolve} + # @param variables [Hash] values for `$variables` in the query + # @param operation_name [String] if the query string contains many operations, this is the one which should be executed + # @param root_value [Object] the object used to resolve fields on the root type + # @param max_depth [Numeric] the maximum number of nested selections allowed for this query (falls back to schema-level value) + # @param max_complexity [Numeric] the maximum field complexity for this query (falls back to schema-level value) + # @param visibility_profile [Symbol] Another way to assign `context[:visibility_profile]` + # + # pkg:gem/graphql#lib/graphql/query.rb:136 + def initialize(schema, query_string = T.unsafe(nil), query: T.unsafe(nil), document: T.unsafe(nil), context: T.unsafe(nil), variables: T.unsafe(nil), multiplex: T.unsafe(nil), validate: T.unsafe(nil), static_validator: T.unsafe(nil), visibility_profile: T.unsafe(nil), subscription_topic: T.unsafe(nil), operation_name: T.unsafe(nil), root_value: T.unsafe(nil), max_depth: T.unsafe(nil), max_complexity: T.unsafe(nil), warden: T.unsafe(nil), use_visibility_profile: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query.rb:371 + def analysis_errors; end + + # pkg:gem/graphql#lib/graphql/query.rb:371 + def analysis_errors=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def analyzers(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def ast_analyzers(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:65 + def context; end + + # @return [GraphQL::Tracing::Trace] + # + # pkg:gem/graphql#lib/graphql/query.rb:225 + def current_trace; end + + # @return [GraphQL::Language::Nodes::Document] + # + # pkg:gem/graphql#lib/graphql/query.rb:102 + def document; end + + # pkg:gem/graphql#lib/graphql/query.rb:295 + def executed?; end + + # This contains a few components: + # + # - The selected operation name (or `anonymous`) + # - The fingerprint of the query string + # - The number of given variables (for readability) + # - The fingerprint of the given variables + # + # This fingerprint can be used to track runs of the same operation-variables combination over time. + # + # @see operation_fingerprint + # @see variables_fingerprint + # @return [String] An opaque hash identifying this operation-variables combination + # + # pkg:gem/graphql#lib/graphql/query.rb:350 + def fingerprint; end + + # pkg:gem/graphql#lib/graphql/query.rb:258 + def fragments; end + + # pkg:gem/graphql#lib/graphql/query.rb:384 + def get_field(owner, field_name); end + + # pkg:gem/graphql#lib/graphql/query.rb:380 + def get_type(type_name); end + + # pkg:gem/graphql#lib/graphql/query.rb:111 + def inspect; end + + # pkg:gem/graphql#lib/graphql/query.rb:441 + def logger; end + + # A lookahead for the root selections of this query + # @return [GraphQL::Execution::Lookahead] + # + # pkg:gem/graphql#lib/graphql/query.rb:235 + def lookahead; end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def max_complexity(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def max_depth(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:222 + def multiplex; end + + # pkg:gem/graphql#lib/graphql/query.rb:222 + def multiplex=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query.rb:429 + def mutation?; end + + # @return [String] An opaque hash for identifying this query's given query string and selected operation + # + # pkg:gem/graphql#lib/graphql/query.rb:355 + def operation_fingerprint; end + + # @return [nil, String] The operation name provided by client or the one inferred from the document. Used to determine which operation to run. + # + # pkg:gem/graphql#lib/graphql/query.rb:71 + def operation_name; end + + # @return [nil, String] The operation name provided by client or the one inferred from the document. Used to determine which operation to run. + # + # pkg:gem/graphql#lib/graphql/query.rb:71 + def operation_name=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query.rb:262 + def operations; end + + # pkg:gem/graphql#lib/graphql/query.rb:266 + def path; end + + # pkg:gem/graphql#lib/graphql/query.rb:388 + def possible_types(type); end + + # pkg:gem/graphql#lib/graphql/query.rb:65 + def provided_variables; end + + # pkg:gem/graphql#lib/graphql/query.rb:433 + def query?; end + + # If a document was provided to `GraphQL::Schema#execute` instead of the raw query string, we will need to get it from the document + # + # pkg:gem/graphql#lib/graphql/query.rb:215 + def query_string; end + + # If a document was provided to `GraphQL::Schema#execute` instead of the raw query string, we will need to get it from the document + # + # pkg:gem/graphql#lib/graphql/query.rb:99 + def query_string=(_arg0); end + + # @param abstract_type [GraphQL::UnionType, GraphQL::InterfaceType] + # @param value [Object] Any runtime value + # @return [GraphQL::ObjectType, nil] The runtime type of `value` from {Schema#resolve_type} + # @see {#possible_types} to apply filtering from `only` / `except` + # + # pkg:gem/graphql#lib/graphql/query.rb:417 + def resolve_type(abstract_type, value = T.unsafe(nil)); end + + # Get the result for this query, executing it once + # @return [GraphQL::Query::Result] A Hash-like GraphQL response, with `"data"` and/or `"errors"` keys + # + # pkg:gem/graphql#lib/graphql/query.rb:288 + def result; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query.rb:256 + def result_values; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query.rb:246 + def result_values=(result_hash); end + + # pkg:gem/graphql#lib/graphql/query.rb:405 + def root_type; end + + # pkg:gem/graphql#lib/graphql/query.rb:392 + def root_type_for_operation(op_type); end + + # The value for root types + # + # pkg:gem/graphql#lib/graphql/query.rb:68 + def root_value; end + + # The value for root types + # + # pkg:gem/graphql#lib/graphql/query.rb:68 + def root_value=(_arg0); end + + # Run subtree partials of this query and return their results. + # Each partial is identified with a `path:` and `object:` + # where the path references a field in the AST and the object will be treated + # as the return value from that field. Subfields of the field named by `path` + # will be executed with `object` as the starting point + # @param partials_hashes [Array Object}>] Hashes with `path:` and `object:` keys + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/query.rb:277 + def run_partials(partials_hashes); end + + # A version of the given query string, with: + # - Variables inlined to the query + # - Strings replaced with `` + # @return [String, nil] Returns nil if the query is invalid. + # + # pkg:gem/graphql#lib/graphql/query.rb:332 + def sanitized_query_string(inline_variables: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query.rb:65 + def schema; end + + # This is the operation to run for this query. + # If more than one operation is present, it must be named at runtime. + # @return [GraphQL::Language::Nodes::OperationDefinition, nil] + # + # pkg:gem/graphql#lib/graphql/query.rb:306 + def selected_operation; end + + # @return [String, nil] The name of the operation to run (may be inferred) + # + # pkg:gem/graphql#lib/graphql/query.rb:116 + def selected_operation_name; end + + # pkg:gem/graphql#lib/graphql/query.rb:299 + def static_errors; end + + # @return [GraphQL::StaticValidation::Validator] if present, the query will validate with these rules. + # + # pkg:gem/graphql#lib/graphql/query.rb:86 + def static_validator; end + + # @param new_validator [GraphQL::StaticValidation::Validator] if present, the query will validate with these rules. This can't be reasssigned after validation. + # + # pkg:gem/graphql#lib/graphql/query.rb:89 + def static_validator=(new_validator); end + + # pkg:gem/graphql#lib/graphql/query.rb:437 + def subscription?; end + + # @return [String, nil] the triggered event, if this query is a subscription update + # + # pkg:gem/graphql#lib/graphql/query.rb:122 + def subscription_topic; end + + # pkg:gem/graphql#lib/graphql/query.rb:229 + def subscription_update?; end + + # pkg:gem/graphql#lib/graphql/query.rb:124 + def tracers; end + + # pkg:gem/graphql#lib/graphql/query.rb:409 + def types; end + + # pkg:gem/graphql#lib/graphql/query.rb:372 + def valid?; end + + # @return [Boolean] if false, static validation is skipped (execution behavior for invalid queries is undefined) + # + # pkg:gem/graphql#lib/graphql/query.rb:74 + def validate; end + + # @param new_validate [Boolean] if false, static validation is skipped. This can't be reasssigned after validation. + # + # pkg:gem/graphql#lib/graphql/query.rb:77 + def validate=(new_validate); end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def validate_timeout_remaining(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:368 + def validation_errors(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query.rb:364 + def validation_pipeline; end + + # Determine the values for variables of this query, using default values + # if a value isn't provided at runtime. + # + # If some variable is invalid, errors are added to {#validation_errors}. + # + # @return [GraphQL::Query::Variables] Variables to apply to this query + # + # pkg:gem/graphql#lib/graphql/query.rb:316 + def variables; end + + # @return [String] An opaque hash for identifying this query's given a variable values (not including defaults) + # + # pkg:gem/graphql#lib/graphql/query.rb:360 + def variables_fingerprint; end + + # @return [Symbol, nil] + # + # pkg:gem/graphql#lib/graphql/query.rb:220 + def visibility_profile; end + + # pkg:gem/graphql#lib/graphql/query.rb:376 + def warden; end + + private + + # pkg:gem/graphql#lib/graphql/query.rb:445 + def find_operation(operations, operation_name); end + + # pkg:gem/graphql#lib/graphql/query.rb:455 + def prepare_ast; end + + # Since the query string is processed at the last possible moment, + # any internal values which depend on it should be accessed within this wrapper. + # + # pkg:gem/graphql#lib/graphql/query.rb:519 + def with_prepared_ast; end +end + +# Expose some query-specific info to field resolve functions. +# It delegates `[]` to the hash that's passed to `GraphQL::Query#initialize`. +# +# pkg:gem/graphql#lib/graphql/query/context.rb:7 +class GraphQL::Query::Context + include ::GraphQL::Schema::Member::HasDataloader + extend ::Forwardable + + # Make a new context which delegates key lookup to `values` + # @param query [GraphQL::Query] the query who owns this context + # @param values [Hash] A hash of arbitrary values which will be accessible at query-time + # + # pkg:gem/graphql#lib/graphql/query/context.rb:46 + def initialize(query:, values:, schema: T.unsafe(nil)); end + + # Lookup `key` from the hash passed to {Schema#execute} as `context:` + # + # pkg:gem/graphql#lib/graphql/query/context.rb:93 + def [](key); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:76 + def []=(key, value); end + + # Add error at query-level. + # @param error [GraphQL::ExecutionError] an execution error + # @return [void] + # + # pkg:gem/graphql#lib/graphql/query/context.rb:121 + def add_error(error); end + + # @example Print the GraphQL backtrace during field resolution + # puts ctx.backtrace + # + # @return [GraphQL::Backtrace] The backtrace for this point in query execution + # + # pkg:gem/graphql#lib/graphql/query/context.rb:139 + def backtrace; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:147 + def current_path; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:63 + def dataloader; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:161 + def delete(key); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:189 + def dig(key, *other_keys); end + + # @return [Array] errors returned during execution + # + # pkg:gem/graphql#lib/graphql/query/context.rb:35 + def errors; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:143 + def execution_errors; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:171 + def fetch(key, default = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:248 + def inspect; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query/context.rb:68 + def interpreter=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:216 + def key?(key); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:244 + def logger; end + + # Get an isolated hash for `ns`. Doesn't affect user-provided storage. + # @param ns [Object] a usage-specific namespace identifier + # @return [Hash] namespaced storage + # + # pkg:gem/graphql#lib/graphql/query/context.rb:231 + def namespace(ns); end + + # @return [Boolean] true if this namespace was accessed before + # + # pkg:gem/graphql#lib/graphql/query/context.rb:240 + def namespace?(ns); end + + # @return [GraphQL::Query] The query whose context this is + # + # pkg:gem/graphql#lib/graphql/query/context.rb:38 + def query; end + + # @param value [Object] Any object to be inserted directly into the final response + # @return [GraphQL::Execution::Interpreter::RawValue] Return this from the field + # + # pkg:gem/graphql#lib/graphql/query/context.rb:131 + def raw_value(value); end + + # Modify this hash to return extensions to client. + # @return [Hash] A hash that will be added verbatim to the result hash, as `"extensions" => { ... }` + # + # pkg:gem/graphql#lib/graphql/query/context.rb:59 + def response_extensions; end + + # @return [GraphQL::Schema] + # + # pkg:gem/graphql#lib/graphql/query/context.rb:41 + def schema; end + + # Use this when you need to do a scoped set _inside_ a lazy-loaded (or batch-loaded) + # block of code. + # + # @example using scoped context inside a promise + # scoped_ctx = context.scoped + # SomeBatchLoader.load(...).then do |thing| + # # use a scoped_ctx which was created _before_ dataloading: + # scoped_ctx.set!(:thing, thing) + # end + # @return [Context::Scoped] + # + # pkg:gem/graphql#lib/graphql/query/context.rb:271 + def scoped; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query/context.rb:74 + def scoped_context; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:252 + def scoped_merge!(hash); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:256 + def scoped_set!(key, value); end + + # Return this value to tell the runtime + # to exclude this field from the response altogether + # + # pkg:gem/graphql#lib/graphql/query/context.rb:114 + def skip; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:206 + def to_h; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:214 + def to_hash; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:80 + def trace(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:82 + def types; end + + # pkg:gem/graphql#lib/graphql/query/context.rb:86 + def types=(_arg0); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query/context.rb:71 + def value=(_arg0); end + + # @return [GraphQL::Schema::Warden] + # @api private + # + # pkg:gem/graphql#lib/graphql/query/context.rb:221 + def warden; end + + # @return [GraphQL::Schema::Warden] + # @api private + # + # pkg:gem/graphql#lib/graphql/query/context.rb:226 + def warden=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/query/context.rb:9 +class GraphQL::Query::Context::ExecutionErrors + # pkg:gem/graphql#lib/graphql/query/context.rb:10 + def initialize(ctx); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:27 + def >>(err_or_msg); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:14 + def add(err_or_msg); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:28 + def push(err_or_msg); end +end + +# pkg:gem/graphql#lib/graphql/query/context.rb:88 +GraphQL::Query::Context::RUNTIME_METADATA_KEYS = T.let(T.unsafe(nil), Set) + +# pkg:gem/graphql#lib/graphql/query/context.rb:275 +class GraphQL::Query::Context::Scoped + # pkg:gem/graphql#lib/graphql/query/context.rb:276 + def initialize(scoped_context, path); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:281 + def merge!(hash); end + + # pkg:gem/graphql#lib/graphql/query/context.rb:285 + def set!(key, value); end +end + +# pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:5 +class GraphQL::Query::Context::ScopedContext + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:6 + def initialize(query_context); end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:46 + def [](key); end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:55 + def current_path; end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:59 + def dig(key, *other_keys); end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:35 + def key?(key); end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:24 + def merge!(hash, at: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:12 + def merged_context; end + + private + + # Start at the current location, + # but look up the tree for previously-assigned scoped values + # + # pkg:gem/graphql#lib/graphql/query/context/scoped_context.rb:77 + def each_present_path_ctx; end +end + +# pkg:gem/graphql#lib/graphql/query/context.rb:169 +GraphQL::Query::Context::UNSPECIFIED_FETCH_DEFAULT = T.let(T.unsafe(nil), Object) + +# @api private +# @see Query#query_fingerprint +# @see Query#variables_fingerprint +# @see Query#fingerprint +# +# pkg:gem/graphql#lib/graphql/query/fingerprint.rb:11 +module GraphQL::Query::Fingerprint + class << self + # Make an obfuscated hash of the given string (either a query string or variables JSON) + # @param string [String] + # @return [String] A normalized, opaque hash + # + # pkg:gem/graphql#lib/graphql/query/fingerprint.rb:15 + def generate(input_str); end + end +end + +# pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:4 +class GraphQL::Query::InputValidationResult + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:13 + def initialize(valid: T.unsafe(nil), problems: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:22 + def add_problem(explanation, path = T.unsafe(nil), extensions: T.unsafe(nil), message: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:35 + def merge_result!(path, inner_result); end + + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:5 + def problems; end + + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:5 + def problems=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:18 + def valid?; end + + class << self + # pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:7 + def from_problem(explanation, path = T.unsafe(nil), extensions: T.unsafe(nil), message: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/query/input_validation_result.rb:48 +GraphQL::Query::InputValidationResult::VALID = T.let(T.unsafe(nil), GraphQL::Query::InputValidationResult) + +# This object can be `ctx` in places where there is no query +# +# pkg:gem/graphql#lib/graphql/query/null_context.rb:6 +class GraphQL::Query::NullContext < ::GraphQL::Query::Context + # pkg:gem/graphql#lib/graphql/query/null_context.rb:29 + def initialize(schema: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:27 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:26 + def dataloader; end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:27 + def dig(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:27 + def fetch(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:27 + def key?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:26 + def query; end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:26 + def schema; end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:27 + def to_h(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:26 + def warden; end + + class << self + # pkg:gem/graphql#lib/graphql/query/null_context.rb:7 + def instance; end + + # pkg:gem/graphql#lib/graphql/query/null_context.rb:11 + def instance=(new_inst); end + end +end + +# pkg:gem/graphql#lib/graphql/query/null_context.rb:15 +class GraphQL::Query::NullContext::NullQuery + # pkg:gem/graphql#lib/graphql/query/null_context.rb:16 + def after_lazy(value); end +end + +# pkg:gem/graphql#lib/graphql/query/null_context.rb:21 +class GraphQL::Query::NullContext::NullSchema < ::GraphQL::Schema; end + +# pkg:gem/graphql#lib/graphql/query.rb:54 +class GraphQL::Query::OperationNameMissingError < ::GraphQL::ExecutionError + # pkg:gem/graphql#lib/graphql/query.rb:55 + def initialize(name); end +end + +# This class is _like_ a {GraphQL::Query}, except it can run on an arbitrary path within a query string. +# +# It depends on a "parent" {Query}. +# +# During execution, it calls query-related tracing hooks but passes itself as `query:`. +# +# The {Partial} will use your {Schema.resolve_type} hook to find the right GraphQL type to use for +# `object` in some cases. +# +# @see Query#run_partials Run via {Query#run_partials} +# +# pkg:gem/graphql#lib/graphql/query/partial.rb:14 +class GraphQL::Query::Partial + include ::GraphQL::Query::Runnable + + # @param path [Array] A path in `query.query_string` to start executing from + # @param object [Object] A starting object for execution + # @param query [GraphQL::Query] A full query instance that this partial is based on. Caches are shared. + # @param context [Hash] Extra context values to merge into `query.context`, if provided + # @param fragment_node [GraphQL::Language::Nodes::InlineFragment, GraphQL::Language::Nodes::FragmentDefinition] + # + # pkg:gem/graphql#lib/graphql/query/partial.rb:22 + def initialize(object:, query:, path: T.unsafe(nil), context: T.unsafe(nil), fragment_node: T.unsafe(nil), type: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:118 + def analysis_errors=(_ignored); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:114 + def analyzers; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def ast_nodes; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def context; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:78 + def current_trace; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def field_definition; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:94 + def fragments; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:51 + def leaf?; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:61 + def multiplex; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:61 + def multiplex=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def object; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def path; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def query; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:106 + def query?; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:86 + def resolve_type(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:74 + def result; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:61 + def result_values; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:61 + def result_values=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def root_type; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:55 + def root_value; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:110 + def run_partials(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:59 + def schema; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:126 + def selected_operation; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:134 + def selected_operation_name; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:130 + def static_errors; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:122 + def subscription?; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:82 + def types; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:102 + def valid?; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:98 + def validate; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:90 + def variables; end + + private + + # pkg:gem/graphql#lib/graphql/query/partial.rb:140 + def set_type_info_from_path; end +end + +# pkg:gem/graphql#lib/graphql/query/partial.rb:63 +class GraphQL::Query::Partial::Result < ::GraphQL::Query::Result + # @return [GraphQL::Query::Partial] + # + # pkg:gem/graphql#lib/graphql/query/partial.rb:69 + def partial; end + + # pkg:gem/graphql#lib/graphql/query/partial.rb:64 + def path; end +end + +# A result from {Schema#execute}. +# It provides the requested data and +# access to the {Query} and {Query::Context}. +# +# pkg:gem/graphql#lib/graphql/query/result.rb:8 +class GraphQL::Query::Result + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/query/result.rb:11 + def initialize(query:, values:); end + + # A result is equal to another object when: + # + # - The other object is a Hash whose value matches `result.to_h` + # - The other object is a Result whose value matches `result.to_h` + # + # (The query is ignored for comparing result equality.) + # + # @return [Boolean] + # + # pkg:gem/graphql#lib/graphql/query/result.rb:51 + def ==(other); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:24 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:24 + def as_json(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:22 + def context(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:39 + def inspect; end + + # pkg:gem/graphql#lib/graphql/query/result.rb:24 + def keys(*_arg0, **_arg1, &_arg2); end + + # Delegate any hash-like method to the underlying hash. + # + # pkg:gem/graphql#lib/graphql/query/result.rb:27 + def method_missing(method_name, *args, &block); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:22 + def mutation?(*_arg0, **_arg1, &_arg2); end + + # @return [GraphQL::Query] The query that was executed + # + # pkg:gem/graphql#lib/graphql/query/result.rb:17 + def query; end + + # pkg:gem/graphql#lib/graphql/query/result.rb:22 + def query?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:22 + def subscription?(*_arg0, **_arg1, &_arg2); end + + # @return [Hash] The resulting hash of "data" and/or "errors" + # + # pkg:gem/graphql#lib/graphql/query/result.rb:20 + def to_h; end + + # pkg:gem/graphql#lib/graphql/query/result.rb:24 + def to_json(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/result.rb:24 + def values(*_arg0, **_arg1, &_arg2); end + + private + + # pkg:gem/graphql#lib/graphql/query/result.rb:35 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# Code shared with {Partial} +# +# pkg:gem/graphql#lib/graphql/query.rb:21 +module GraphQL::Query::Runnable + # pkg:gem/graphql#lib/graphql/query.rb:22 + def after_lazy(value, &block); end + + # pkg:gem/graphql#lib/graphql/query.rb:43 + def arguments_cache; end + + # Node-level cache for calculating arguments. Used during execution and query analysis. + # @param ast_node [GraphQL::Language::Nodes::AbstractNode] + # @param definition [GraphQL::Schema::Field] + # @param parent_object [GraphQL::Schema::Object] + # @return [Hash{Symbol => Object}] + # + # pkg:gem/graphql#lib/graphql/query.rb:39 + def arguments_for(ast_node, definition, parent_object: T.unsafe(nil)); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/query.rb:48 + def handle_or_reraise(err, **kwargs); end +end + +# Contain the validation pipeline and expose the results. +# +# 0. Checks in {Query#initialize}: +# - Rescue a ParseError, halt if there is one +# - Check for selected operation, halt if not found +# 1. Validate the AST, halt if errors +# 2. Validate the variables, halt if errors +# 3. Run query analyzers, halt if errors +# +# {#valid?} is false if any of the above checks halted the pipeline. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:16 +class GraphQL::Query::ValidationPipeline + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:19 + def initialize(query:, parse_error:, operation_name_error:, max_depth:, max_complexity:); end + + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:43 + def analyzers; end + + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:48 + def has_validated?; end + + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:17 + def max_complexity; end + + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:17 + def max_depth; end + + # @return [Boolean] does this query have errors that should prevent it from running? + # + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:32 + def valid?; end + + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:17 + def validate_timeout_remaining; end + + # @return [Array] Static validation errors for the query string + # + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:38 + def validation_errors; end + + private + + # If there are max_* values, add them, + # otherwise reuse the schema's list of analyzers. + # + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:96 + def build_analyzers(schema, max_depth, max_complexity); end + + # If the pipeline wasn't run yet, run it. + # If it was already run, do nothing. + # + # pkg:gem/graphql#lib/graphql/query/validation_pipeline.rb:56 + def ensure_has_validated; end +end + +# pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:4 +class GraphQL::Query::VariableValidationError < ::GraphQL::ExecutionError + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:7 + def initialize(variable_ast, type, value, validation_result, msg: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:21 + def to_h; end + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:5 + def validation_result; end + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:5 + def validation_result=(_arg0); end + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:5 + def value; end + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:5 + def value=(_arg0); end + + private + + # pkg:gem/graphql#lib/graphql/query/variable_validation_error.rb:36 + def problem_fields; end +end + +# Read-only access to query variables, applying default values if needed. +# +# pkg:gem/graphql#lib/graphql/query/variables.rb:5 +class GraphQL::Query::Variables + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/query/variables.rb:13 + def initialize(ctx, ast_variables, provided_variables); end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:66 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:11 + def context; end + + # @return [Array] Any errors encountered when parsing the provided variables and literal values + # + # pkg:gem/graphql#lib/graphql/query/variables.rb:9 + def errors; end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:66 + def fetch(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:66 + def key?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:66 + def length(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:66 + def to_h(*_arg0, **_arg1, &_arg2); end + + private + + # pkg:gem/graphql#lib/graphql/query/variables.rb:85 + def add_max_errors_reached_message; end + + # pkg:gem/graphql#lib/graphql/query/variables.rb:70 + def deep_stringify(val); end +end + +# pkg:gem/graphql#lib/graphql/relay/range_add.rb:3 +module GraphQL::Relay; end + +# This provides some isolation from `GraphQL::Relay` internals. +# +# Given a list of items and a new item, it will provide a connection and an edge. +# +# The connection doesn't receive outside arguments, so the list of items +# should be ordered and paginated before providing it here. +# +# @example Adding a comment to list of comments +# post = Post.find(args[:post_id]) +# comments = post.comments +# new_comment = comments.build(body: args[:body]) +# new_comment.save! +# +# range_add = GraphQL::Relay::RangeAdd.new( +# parent: post, +# collection: comments, +# item: new_comment, +# context: context, +# ) +# +# response = { +# post: post, +# comments_connection: range_add.connection, +# new_comment_edge: range_add.edge, +# } +# +# pkg:gem/graphql#lib/graphql/relay/range_add.rb:29 +class GraphQL::Relay::RangeAdd + # @param collection [Object] The list of items to wrap in a connection + # @param item [Object] The newly-added item (will be wrapped in `edge_class`) + # @param context [GraphQL::Query::Context] The surrounding `ctx`, will be passed to the connection + # @param parent [Object] The owner of `collection`, will be passed to the connection if provided + # @param edge_class [Class] The class to wrap `item` with (defaults to the connection's edge class) + # + # pkg:gem/graphql#lib/graphql/relay/range_add.rb:37 + def initialize(collection:, item:, context:, parent: T.unsafe(nil), edge_class: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/relay/range_add.rb:30 + def connection; end + + # pkg:gem/graphql#lib/graphql/relay/range_add.rb:30 + def edge; end + + # pkg:gem/graphql#lib/graphql/relay/range_add.rb:30 + def parent; end +end + +# pkg:gem/graphql#lib/graphql.rb:35 +class GraphQL::RequiredImplementationMissingError < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/runtime_error.rb:3 +class GraphQL::RuntimeError < ::GraphQL::Error + include ::GraphQL::Execution::Finalizer +end + +# pkg:gem/graphql#lib/graphql/runtime_type_error.rb:3 +class GraphQL::RuntimeTypeError < ::GraphQL::Error; end + +# A GraphQL schema which may be queried with {GraphQL::Query}. +# +# The {Schema} contains: +# +# - types for exposing your application +# - query analyzers for assessing incoming queries (including max depth & max complexity restrictions) +# - execution strategies for running incoming queries +# +# Schemas start with root types, {Schema#query}, {Schema#mutation} and {Schema#subscription}. +# The schema will traverse the tree of fields & types, using those as starting points. +# Any undiscoverable types may be provided with the `types` configuration. +# +# Schemas can restrict large incoming queries with `max_depth` and `max_complexity` configurations. +# (These configurations can be overridden by specific calls to {Schema.execute}) +# +# @example defining a schema +# class MySchema < GraphQL::Schema +# query QueryType +# # If types are only connected by way of interfaces, they must be added here +# orphan_types ImageType, AudioType +# end +# +# pkg:gem/graphql#lib/graphql/schema/addition.rb:4 +class GraphQL::Schema + extend ::GraphQL::Schema::Member::HasAstNode + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Autoload + + class << self + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1663 + def add_subscription_extension_if_necessary; end + + # Return a lazy if any of `maybe_lazies` are lazy, + # otherwise, call the block eagerly and return the result. + # @param maybe_lazies [Array] + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1728 + def after_any_lazies(maybe_lazies); end + + # Call the given block at the right time, either: + # - Right away, if `value` is not registered with `lazy_resolve` + # - After resolving `value`, if it's registered with `lazy_resolve` (eg, `Promise`) + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1688 + def after_lazy(value, &block); end + + # This setting controls how GraphQL-Ruby handles empty selections on Union types. + # + # To opt into future, spec-compliant behavior where these selections are rejected, set this to `false`. + # + # If you need to support previous, non-spec behavior which allowed selecting union fields + # but *not* selecting any fields on that union, set this to `true` to continue allowing that behavior. + # + # If this is `true`, then {.legacy_invalid_empty_selections_on_union_with_type} will be called with {Query} objects + # with that kind of selections. You must implement that method + # @param new_value [Boolean] + # @return [true, false, nil] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1764 + def allow_legacy_invalid_empty_selections_on_union(new_value = T.unsafe(nil)); end + + # This setting controls how GraphQL-Ruby handles overlapping selections on scalar types when the types + # don't match. + # + # When set to `false`, GraphQL-Ruby will reject those queries with a validation error (as per the GraphQL spec). + # + # When set to `true`, GraphQL-Ruby will call {.legacy_invalid_return_type_conflicts} when the scenario is encountered. + # + # @param new_value [Boolean] `true` permits the legacy behavior, `false` rejects it. + # @return [true, false, nil] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1816 + def allow_legacy_invalid_return_type_conflicts(new_value = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:917 + def analysis_engine; end + + # pkg:gem/graphql#lib/graphql/schema.rb:915 + def analysis_engine=(_arg0); end + + # Return the Hash response of {Introspection::INTROSPECTION_QUERY}. + # @param context [Hash] + # @param include_deprecated_args [Boolean] If true, deprecated arguments will be included in the JSON response + # @param include_schema_description [Boolean] If true, the schema's description will be queried and included in the response + # @param include_is_repeatable [Boolean] If true, `isRepeatable: true|false` will be included with the schema's directives + # @param include_specified_by_url [Boolean] If true, scalar types' `specifiedByUrl:` will be included in the response + # @param include_is_one_of [Boolean] If true, `isOneOf: true|false` will be included with input objects + # @return [Hash] GraphQL result + # + # pkg:gem/graphql#lib/graphql/schema.rb:269 + def as_json(context: T.unsafe(nil), include_deprecated_args: T.unsafe(nil), include_schema_description: T.unsafe(nil), include_is_repeatable: T.unsafe(nil), include_specified_by_url: T.unsafe(nil), include_is_one_of: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:212 + def build_trace_mode(mode); end + + # The legacy complexity implementation included several bugs: + # + # - In some cases, it used the lexically _last_ field to determine a cost, instead of calculating the maximum among selections + # - In some cases, it called field complexity hooks repeatedly (when it should have only called them once) + # + # The future implementation may produce higher total complexity scores, so it's not active by default yet. You can opt into + # the future default behavior by configuring `:future` here. Or, you can choose a mode for each query with {.complexity_cost_calculation_mode_for}. + # + # The legacy mode is currently maintained alongside the future one, but it will be removed in a future GraphQL-Ruby version. + # + # If you choose `:compare`, you must also implement {.legacy_complexity_cost_calculation_mismatch} to handle the input somehow. + # + # @example Opting into the future calculation mode + # complexity_cost_calculation_mode(:future) + # + # @example Choosing the legacy mode (which will work until that mode is removed...) + # complexity_cost_calculation_mode(:legacy) + # + # @example Run both modes for every query, call {.legacy_complexity_cost_calculation_mismatch} when they don't match: + # complexity_cost_calculation_mode(:compare) + # + # pkg:gem/graphql#lib/graphql/schema.rb:1868 + def complexity_cost_calculation_mode(new_mode = T.unsafe(nil)); end + + # Implement this method to produce a per-query complexity cost calculation mode. (Technically, it's per-multiplex.) + # + # This is a way to check the compatibility of queries coming to your API without adding overhead of running `:compare` + # for every query. You could sample traffic, turn it off/on with feature flags, or anything else. + # + # @example Sampling traffic + # def self.complexity_cost_calculation_mode_for(_context) + # if rand < 0.1 # 10% of the time + # :compare + # else + # :legacy + # end + # end + # + # @example Using a feature flag to manage future mode + # def complexity_cost_calculation_mode_for(context) + # current_user = context[:current_user] + # if Flipper.enabled?(:future_complexity_cost, current_user) + # :future + # elsif rand < 0.5 # 50% + # :compare + # else + # :legacy + # end + # end + # + # @param multiplex_context [Hash] The context for the currently-running {Execution::Multiplex} (which contains one or more queries) + # @return [:future] Use the new calculation algorithm -- may be higher than `:legacy` + # @return [:legacy] Use the legacy calculation algorithm, warts and all + # @return [:compare] Run both algorithms and call {.legacy_complexity_cost_calculation_mismatch} if they don't match + # + # pkg:gem/graphql#lib/graphql/schema.rb:1910 + def complexity_cost_calculation_mode_for(multiplex_context); end + + # @api private + # @return [GraphQL::Pagination::Connections] if installed + # + # pkg:gem/graphql#lib/graphql/schema.rb:423 + def connections; end + + # @api private + # @return [GraphQL::Pagination::Connections] if installed + # + # pkg:gem/graphql#lib/graphql/schema.rb:420 + def connections=(_arg0); end + + # @param new_context_class [Class] A subclass to use when executing queries + # + # pkg:gem/graphql#lib/graphql/schema.rb:1104 + def context_class(new_context_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:945 + def count_introspection_fields; end + + # pkg:gem/graphql#lib/graphql/schema.rb:776 + def cursor_encoder(new_encoder = T.unsafe(nil)); end + + # @api private + # @see GraphQL::Dataloader + # + # pkg:gem/graphql#lib/graphql/schema.rb:679 + def dataloader_class; end + + # @api private + # @see GraphQL::Dataloader + # + # pkg:gem/graphql#lib/graphql/schema.rb:683 + def dataloader_class=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1061 + def default_analysis_engine; end + + # pkg:gem/graphql#lib/graphql/schema.rb:1408 + def default_directives; end + + # pkg:gem/graphql#lib/graphql/schema.rb:1643 + def default_execution_next(new_value = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1053 + def default_execution_strategy; end + + # @param new_default_logger [#log] Something to use for logging messages + # + # pkg:gem/graphql#lib/graphql/schema.rb:1071 + def default_logger(new_default_logger = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:783 + def default_max_page_size(new_default_max_page_size = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:802 + def default_page_size(new_default_page_size = T.unsafe(nil)); end + + # @param new_mode [Symbol] If configured, this will be used when `context: { trace_mode: ... }` isn't set. + # + # pkg:gem/graphql#lib/graphql/schema.rb:152 + def default_trace_mode(new_mode = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:138 + def deprecated_graphql_definition; end + + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema.rb:295 + def description(new_description = T.unsafe(nil)); end + + # @return [GraphQL::Tracing::DetailedTrace] if it has been configured for this schema + # + # pkg:gem/graphql#lib/graphql/schema.rb:1419 + def detailed_trace; end + + # @return [GraphQL::Tracing::DetailedTrace] if it has been configured for this schema + # + # pkg:gem/graphql#lib/graphql/schema.rb:1419 + def detailed_trace=(_arg0); end + + # @param query [GraphQL::Query, GraphQL::Execution::Multiplex] Called with a multiplex when multiple queries are executed at once (with {.multiplex}) + # @return [Boolean] When `true`, save a detailed trace for this query. + # @see Tracing::DetailedTrace DetailedTrace saves traces when this method returns true + # + # pkg:gem/graphql#lib/graphql/schema.rb:1424 + def detailed_trace?(query); end + + # Returns `DidYouMean` if it's defined. + # Override this to return `nil` if you don't want to use `DidYouMean` + # + # pkg:gem/graphql#lib/graphql/schema.rb:1740 + def did_you_mean(new_dym = T.unsafe(nil)); end + + # Attach a single directive to this schema + # @param new_directive [Class] + # @return void + # + # pkg:gem/graphql#lib/graphql/schema.rb:1400 + def directive(new_directive); end + + # Add several directives at once + # @param new_directives [Class] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1384 + def directives(*new_directives); end + + # pkg:gem/graphql#lib/graphql/schema.rb:953 + def disable_introspection_entry_points; end + + # pkg:gem/graphql#lib/graphql/schema.rb:971 + def disable_introspection_entry_points?; end + + # pkg:gem/graphql#lib/graphql/schema.rb:959 + def disable_schema_introspection_entry_point; end + + # pkg:gem/graphql#lib/graphql/schema.rb:979 + def disable_schema_introspection_entry_point?; end + + # pkg:gem/graphql#lib/graphql/schema.rb:965 + def disable_type_introspection_entry_point; end + + # pkg:gem/graphql#lib/graphql/schema.rb:987 + def disable_type_introspection_entry_point?; end + + # pkg:gem/graphql#lib/graphql/schema.rb:921 + def error_bubbling(new_error_bubbling = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:930 + def error_bubbling=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1132 + def error_handlers; end + + # Execute a query on itself. + # @see {Query#initialize} for arguments. + # @return [GraphQL::Query::Result] query result, ready to be serialized as JSON + # + # pkg:gem/graphql#lib/graphql/schema.rb:1586 + def execute(query_str = T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1594 + def execute_legacy(query_str = T.unsafe(nil), **kwargs); end + + # @param new_extra_types [Module] Type definitions to include in printing and introspection, even though they aren't referenced in the schema + # @return [Array] Type definitions added to this schema + # + # pkg:gem/graphql#lib/graphql/schema.rb:997 + def extra_types(*new_extra_types); end + + # pkg:gem/graphql#lib/graphql/schema.rb:305 + def find(path); end + + # Create schema from an IDL schema or file containing an IDL definition. + # @param definition_or_path [String] A schema definition string, or a path to a file containing the definition + # @param default_resolve [<#call(type, field, obj, args, ctx)>] A callable for handling field resolution + # @param parser [Object] An object for handling definition string parsing (must respond to `parse`) + # @param using [Hash] Plugins to attach to the created schema with `use(key, value)` + # @return [Class] the schema described by `document` + # + # pkg:gem/graphql#lib/graphql/schema.rb:115 + def from_definition(definition_or_path, default_resolve: T.unsafe(nil), parser: T.unsafe(nil), using: T.unsafe(nil), base_types: T.unsafe(nil)); end + + # Create schema with the result of an introspection query. + # @param introspection_result [Hash] A response from {GraphQL::Introspection::INTROSPECTION_QUERY} + # @return [Class] the schema described by `input` + # + # pkg:gem/graphql#lib/graphql/schema.rb:105 + def from_introspection(introspection_result); end + + # pkg:gem/graphql#lib/graphql/schema.rb:710 + def get_field(type_or_name, field_name, context = T.unsafe(nil), use_visibility_profile = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:747 + def get_fields(type, context = T.unsafe(nil)); end + + # @param type_name [String] + # @param context [GraphQL::Query::Context] Used for filtering definitions at query-time + # @param use_visibility_profile Private, for migration to {Schema::Visibility} + # @return [Module, nil] A type, or nil if there's no type called `type_name` + # + # pkg:gem/graphql#lib/graphql/schema.rb:375 + def get_type(type_name, context = T.unsafe(nil), use_visibility_profile = T.unsafe(nil)); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1153 + def handle_or_reraise(context, err, object: T.unsafe(nil), arguments: T.unsafe(nil), field: T.unsafe(nil)); end + + # @return [Boolean] Does this schema have _any_ definition for a type named `type_name`, regardless of visibility? + # + # pkg:gem/graphql#lib/graphql/schema.rb:415 + def has_defined_type?(type_name); end + + # Return a stable ID string for `object` so that it can be refetched later, using {.object_from_id}. + # + # [GlobalID](https://github.com/rails/globalid) and [SQIDs](https://sqids.org/ruby) can both be used to create IDs. + # + # @example Using Rails's GlobalID to generate IDs + # def self.id_from_object(application_object, graphql_type, context) + # application_object.to_gid_param + # end + # + # @param application_object [Object] Some object encountered by GraphQL-Ruby while running a query + # @param graphql_type [Class, Module] The type that GraphQL-Ruby is using for `application_object` during this query + # @param context [GraphQL::Query::Context] The context for the operation that is currently running + # @return [String] A stable identifier which can be passed to {.object_from_id} later to re-fetch `application_object` + # + # pkg:gem/graphql#lib/graphql/schema.rb:1267 + def id_from_object(application_object, graphql_type, context); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1218 + def inherited(child_class); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1372 + def instrument(instrument_step, instrumenter, options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1655 + def instrumenters; end + + # Pass a custom introspection module here to use it for this schema. + # @param new_introspection_namespace [Module] If given, use this module for custom introspection on the schema + # @return [Module, nil] The configured namespace, if there is one + # + # pkg:gem/graphql#lib/graphql/schema.rb:754 + def introspection(new_introspection_namespace = T.unsafe(nil)); end + + # @return [Schema::IntrospectionSystem] Based on {introspection} + # + # pkg:gem/graphql#lib/graphql/schema.rb:768 + def introspection_system; end + + # @return [Boolean] True if this object should be lazily resolved + # + # pkg:gem/graphql#lib/graphql/schema.rb:1720 + def lazy?(obj); end + + # @return [Symbol, nil] The method name to lazily resolve `obj`, or nil if `obj`'s class wasn't registered with {.lazy_resolve}. + # + # pkg:gem/graphql#lib/graphql/schema.rb:1715 + def lazy_method_name(obj); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1358 + def lazy_resolve(lazy_class, value_method); end + + # Implement this method in your schema to handle mismatches when `:compare` is used. + # + # @example Logging the mismatch + # def self.legacy_cost_calculation_mismatch(multiplex, future_cost, legacy_cost) + # client_id = multiplex.context[:api_client].id + # operation_names = multiplex.queries.map { |q| q.selected_operation_name || "anonymous" }.join(", ") + # Stats.increment(:complexity_mismatch, tags: { client: client_id, ops: operation_names }) + # legacy_cost + # end + # @see Query::Context#add_error Adding an error to the response to notify the client + # @see Query::Context#response_extensions Adding key-value pairs to the response `"extensions" => { ... }` + # @param multiplex [GraphQL::Execution::Multiplex] + # @param future_complexity_cost [Integer] + # @param legacy_complexity_cost [Integer] + # @return [Integer] the cost to use for this query (probably one of `future_complexity_cost` or `legacy_complexity_cost`) + # + # pkg:gem/graphql#lib/graphql/schema.rb:1929 + def legacy_complexity_cost_calculation_mismatch(multiplex, future_complexity_cost, legacy_complexity_cost); end + + # This method is called during validation when a previously-allowed, but non-spec + # query is encountered where a union field has no child selections on it. + # + # If `legacy_invalid_empty_selections_on_union_with_type` is overridden, this method will not be called. + # + # You should implement this method or `legacy_invalid_empty_selections_on_union_with_type` + # to log the violation so that you can contact clients and notify them about changing their queries. + # Then return a suitable value to tell GraphQL-Ruby how to continue. + # @param query [GraphQL::Query] + # @return [:return_validation_error] Let GraphQL-Ruby return the (new) normal validation error for this query + # @return [String] A validation error to return for this query + # @return [nil] Don't send the client an error, continue the legacy behavior (allow this query to execute) + # + # pkg:gem/graphql#lib/graphql/schema.rb:1788 + def legacy_invalid_empty_selections_on_union(query); end + + # This method is called during validation when a previously-allowed, but non-spec + # query is encountered where a union field has no child selections on it. + # + # You should implement this method to log the violation so that you can contact clients + # and notify them about changing their queries. Then return a suitable value to + # tell GraphQL-Ruby how to continue. + # @param query [GraphQL::Query] + # @param type [Module] A GraphQL type definition + # @return [:return_validation_error] Let GraphQL-Ruby return the (new) normal validation error for this query + # @return [String] A validation error to return for this query + # @return [nil] Don't send the client an error, continue the legacy behavior (allow this query to execute) + # + # pkg:gem/graphql#lib/graphql/schema.rb:1803 + def legacy_invalid_empty_selections_on_union_with_type(query, type); end + + # This method is called when the query contains fields which don't contain matching scalar types. + # This was previously allowed by GraphQL-Ruby but it's a violation of the GraphQL spec. + # + # You should implement this method to log the violation so that you observe usage of these fields. + # Fixing this scenario might mean adding new fields, and telling clients to use those fields. + # (Changing the field return type would be a breaking change, but if it works for your client use cases, + # that might work, too.) + # + # @param query [GraphQL::Query] + # @param type1 [Module] A GraphQL type definition + # @param type2 [Module] A GraphQL type definition + # @param node1 [GraphQL::Language::Nodes::Field] This node is recognized as conflicting. You might call `.line` and `.col` for custom error reporting. + # @param node2 [GraphQL::Language::Nodes::Field] The other node recognized as conflicting. + # @return [:return_validation_error] Let GraphQL-Ruby return the (new) normal validation error for this query + # @return [String] A validation error to return for this query + # @return [nil] Don't send the client an error, continue the legacy behavior (allow this query to execute) + # + # pkg:gem/graphql#lib/graphql/schema.rb:1844 + def legacy_invalid_return_type_conflicts(query, type1, type2, node1, node2); end + + # Called when a type is needed by name at runtime + # + # pkg:gem/graphql#lib/graphql/schema.rb:1285 + def load_type(type_name, ctx); end + + # @param context [GraphQL::Query::Context, nil] + # @return [Logger] A logger to use for this context configuration, falling back to {.default_logger} + # + # pkg:gem/graphql#lib/graphql/schema.rb:1093 + def logger_for(context); end + + # pkg:gem/graphql#lib/graphql/schema.rb:896 + def max_complexity(max_complexity = T.unsafe(nil), count_introspection_fields: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:894 + def max_complexity=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema.rb:907 + def max_complexity_count_introspection_fields; end + + # pkg:gem/graphql#lib/graphql/schema.rb:934 + def max_depth(new_max_depth = T.unsafe(nil), count_introspection_fields: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:932 + def max_depth=(_arg0); end + + # A limit on the number of tokens to accept on incoming query strings. + # Use this to prevent parsing maliciously-large query strings. + # @return [nil, Integer] + # + # pkg:gem/graphql#lib/graphql/schema.rb:794 + def max_query_string_tokens(new_max_tokens = T.unsafe(nil)); end + + # Execute several queries on itself, concurrently. + # + # @example Run several queries at once + # context = { ... } + # queries = [ + # { query: params[:query_1], variables: params[:variables_1], context: context }, + # { query: params[:query_2], variables: params[:variables_2], context: context }, + # ] + # results = MySchema.multiplex(queries) + # render json: { + # result_1: results[0], + # result_2: results[1], + # } + # + # @see {Query#initialize} for query keyword arguments + # @see {Execution::Multiplex#run_all} for multiplex keyword arguments + # @param queries [Array] Keyword arguments for each query + # @option kwargs [Hash] :context ({}) Multiplex-level context + # @option kwargs [nil, Integer] :max_complexity (nil) + # @return [Array] One result for each query in the input + # + # pkg:gem/graphql#lib/graphql/schema.rb:1635 + def multiplex(queries, **kwargs); end + + # @param new_analyzer [Class] An analyzer to run on multiplexes to this schema + # @see GraphQL::Analysis the analysis system + # + # pkg:gem/graphql#lib/graphql/schema.rb:1567 + def multiplex_analyzer(new_analyzer); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1571 + def multiplex_analyzers; end + + # Get or set the root `mutation { ... }` object for this schema. + # + # @example Using `Types::Mutation` as the entry-point + # mutation { Types::Mutation } + # + # @param new_mutation_object [Class] The root type to use for mutations + # @param lazy_load_block If a block is given, then it will be called when GraphQL-Ruby needs the root mutation type. + # @return [Class, nil] The configured mutation root type, if there is one. + # + # pkg:gem/graphql#lib/graphql/schema.rb:485 + def mutation(new_mutation_object = T.unsafe(nil), &lazy_load_block); end + + # pkg:gem/graphql#lib/graphql/schema.rb:822 + def mutation_execution_strategy(new_mutation_execution_strategy = T.unsafe(nil), deprecation_warning: T.unsafe(nil)); end + + # Create a trace instance which will include the trace modules specified for the optional mode. + # + # If no `mode:` is given, then {default_trace_mode} will be used. + # + # If this schema is using {Tracing::DetailedTrace} and {.detailed_trace?} returns `true`, then + # DetailedTrace's mode will override the passed-in `mode`. + # + # @param mode [Symbol] Trace modules for this trade mode will be included + # @param options [Hash] Keywords that will be passed to the tracing class during `#initialize` + # @return [Tracing::Trace] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1525 + def new_trace(mode: T.unsafe(nil), **options); end + + # pkg:gem/graphql#lib/graphql/schema.rb:335 + def null_context; end + + # pkg:gem/graphql#lib/graphql/schema.rb:333 + def null_context=(_arg0); end + + # Fetch an object based on an incoming ID and the current context. This method should return an object + # from your application, or return `nil` if there is no object or the object shouldn't be available to this operation. + # + # @example Fetching an object with Rails's GlobalID + # def self.object_from_id(object_id, _context) + # GlobalID.find(global_id) + # # TODO: use `context[:current_user]` to determine if this object is authorized. + # end + # @param object_id [String] The ID to fetch an object for. This may be client-provided (as in `node(id: ...)` or `loads:`) or previously stored by the schema (eg, by the `ObjectCache`) + # @param context [GraphQL::Query::Context] The context for the currently-executing operation + # @return [Object, nil] The application which `object_id` references, or `nil` if there is no object or the current operation shouldn't have access to the object + # @see id_from_object which produces these IDs + # + # pkg:gem/graphql#lib/graphql/schema.rb:1250 + def object_from_id(object_id, context); end + + # Tell the schema about these types so that they can be registered as implementations of interfaces in the schema. + # + # This method must be used when an object type is connected to the schema as an interface implementor but + # not as a return type of a field. In that case, if the object type isn't registered here, GraphQL-Ruby won't be able to find it. + # + # @param new_orphan_types [Array>] Object types to register as implementations of interfaces in the schema. + # @return [Array>] All previously-registered orphan types for this schema + # + # pkg:gem/graphql#lib/graphql/schema.rb:1022 + def orphan_types(*new_orphan_types); end + + # pkg:gem/graphql#lib/graphql/schema.rb:208 + def own_trace_modes; end + + # pkg:gem/graphql#lib/graphql/schema.rb:240 + def own_trace_modules; end + + # A function to call when {.execute} receives an invalid query string + # + # The default is to add the error to `context.errors` + # @param parse_err [GraphQL::ParseError] The error encountered during parsing + # @param ctx [GraphQL::Query::Context] The context for the query where the error occurred + # @return void + # + # pkg:gem/graphql#lib/graphql/schema.rb:1354 + def parse_error(parse_err, ctx); end + + # pkg:gem/graphql#lib/graphql/schema.rb:329 + def plugins; end + + # @param type [Module] The type definition whose possible types you want to see + # @param context [GraphQL::Query::Context] used for filtering visible possible types at runtime + # @param use_visibility_profile Private, for migration to {Schema::Visibility} + # @return [Hash] All possible types, if no `type` is given. + # @return [Array] Possible types for `type`, if it's given. + # + # pkg:gem/graphql#lib/graphql/schema.rb:626 + def possible_types(type = T.unsafe(nil), context = T.unsafe(nil), use_visibility_profile = T.unsafe(nil)); end + + # Get or set the root `query { ... }` object for this schema. + # + # @example Using `Types::Query` as the entry-point + # query { Types::Query } + # + # @param new_query_object [Class] The root type to use for queries + # @param lazy_load_block If a block is given, then it will be called when GraphQL-Ruby needs the root query type. + # @return [Class, nil] The configured query root type, if there is one. + # + # pkg:gem/graphql#lib/graphql/schema.rb:446 + def query(new_query_object = T.unsafe(nil), &lazy_load_block); end + + # @param new_analyzer [Class] An analyzer to run on queries to this schema + # @see GraphQL::Analysis the analysis system + # + # pkg:gem/graphql#lib/graphql/schema.rb:1556 + def query_analyzer(new_analyzer); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1560 + def query_analyzers; end + + # @param new_query_class [Class] A subclass to use when executing queries + # + # pkg:gem/graphql#lib/graphql/schema.rb:876 + def query_class(new_query_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:810 + def query_execution_strategy(new_query_execution_strategy = T.unsafe(nil), deprecation_warning: T.unsafe(nil)); end + + # Called when execution encounters a `SystemStackError`. By default, it adds a client-facing error to the response. + # You could modify this method to report this error to your bug tracker. + # @param query [GraphQL::Query] + # @param err [SystemStackError] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1680 + def query_stack_error(query, err); end + + # pkg:gem/graphql#lib/graphql/schema.rb:685 + def references_to(to_type = T.unsafe(nil), from: T.unsafe(nil)); end + + # Register a handler for errors raised during execution. The handlers can return a new value or raise a new error. + # + # @example Handling "not found" with a client-facing error + # rescue_from(ActiveRecord::NotFound) { raise GraphQL::ExecutionError, "An object could not be found" } + # + # @param err_classes [Array] Classes which should be rescued by `handler_block` + # @param handler_block The code to run when one of those errors is raised during execution + # @yieldparam error [StandardError] An instance of one of the configured `err_classes` + # @yieldparam object [Object] The current application object in the query when the error was raised + # @yieldparam arguments [GraphQL::Query::Arguments] The current field arguments when the error was raised + # @yieldparam context [GraphQL::Query::Context] The context for the currently-running operation + # @yieldreturn [Object] Some object to use in the place where this error was raised + # @raise [GraphQL::ExecutionError] In the handler, raise to add a client-facing error to the response + # @raise [StandardError] In the handler, raise to crash the query with a developer-facing error + # + # pkg:gem/graphql#lib/graphql/schema.rb:1126 + def rescue_from(*err_classes, &handler_block); end + + # GraphQL-Ruby calls this method during execution when it needs the application to determine the type to use for an object. + # + # Usually, this object was returned from a field whose return type is an {GraphQL::Schema::Interface} or a {GraphQL::Schema::Union}. + # But this method is called in other cases, too -- for example, when {GraphQL::Schema::Argument#loads} cases an object to be directly loaded from the database. + # + # @example Returning a GraphQL type based on the object's class name + # class MySchema < GraphQL::Schema + # def resolve_type(_abs_type, object, _context) + # graphql_type_name = "Types::#{object.class.name}Type" + # graphql_type_name.constantize # If this raises a NameError, then come implement special cases in this method + # end + # end + # @param abstract_type [Class, Module, nil] The Interface or Union type which is being resolved, if there is one + # @param application_object [Object] The object returned from a field whose type must be determined + # @param context [GraphQL::Query::Context] The query context for the currently-executing query + # @return [Class] The root types (query, mutation, subscription) defined for this schema + # + # pkg:gem/graphql#lib/graphql/schema.rb:573 + def root_types; end + + # pkg:gem/graphql#lib/graphql/schema.rb:1575 + def sanitized_printer(new_sanitized_printer = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1275 + def schema_directive(dir_class, **options); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1280 + def schema_directives; end + + # pkg:gem/graphql#lib/graphql/schema.rb:313 + def static_validator; end + + # Get or set the root `subscription { ... }` object for this schema. + # + # @example Using `Types::Subscription` as the entry-point + # subscription { Types::Subscription } + # + # @param new_subscription_object [Class] The root type to use for subscriptions + # @param lazy_load_block If a block is given, then it will be called when GraphQL-Ruby needs the root subscription type. + # @return [Class, nil] The configured subscription root type, if there is one. + # + # pkg:gem/graphql#lib/graphql/schema.rb:524 + def subscription(new_subscription_object = T.unsafe(nil), &lazy_load_block); end + + # pkg:gem/graphql#lib/graphql/schema.rb:834 + def subscription_execution_strategy(new_subscription_execution_strategy = T.unsafe(nil), deprecation_warning: T.unsafe(nil)); end + + # @return [GraphQL::Subscriptions] + # + # pkg:gem/graphql#lib/graphql/schema.rb:143 + def subscriptions(inherited: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:147 + def subscriptions=(new_implementation); end + + # Override this method to handle lazy objects in a custom way. + # @param value [Object] an instance of a class registered with {.lazy_resolve} + # @return [Object] A GraphQL-ready (non-lazy) object + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1704 + def sync_lazy(value); end + + # Return the GraphQL IDL for the schema + # @param context [Hash] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema.rb:284 + def to_definition(context: T.unsafe(nil)); end + + # Return the GraphQL::Language::Document IDL AST for the schema + # @return [GraphQL::Language::Document] + # + # pkg:gem/graphql#lib/graphql/schema.rb:290 + def to_document; end + + # Returns the JSON response of {Introspection::INTROSPECTION_QUERY}. + # @see #as_json Return a Hash representation of the schema + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema.rb:257 + def to_json(**args); end + + # pkg:gem/graphql#lib/graphql/schema.rb:166 + def trace_class(new_class = T.unsafe(nil)); end + + # @return [Class] Return the trace class to use for this mode, looking one up on the superclass if this Schema doesn't have one defined. + # + # pkg:gem/graphql#lib/graphql/schema.rb:179 + def trace_class_for(mode, build: T.unsafe(nil)); end + + # Configure `trace_class` to be used whenever `context: { trace_mode: mode_name }` is requested. + # {default_trace_mode} is used when no `trace_mode: ...` is requested. + # + # When a `trace_class` is added this way, it will _not_ receive other modules added with `trace_with(...)` + # unless `trace_mode` is explicitly given. (This class will not receive any default trace modules.) + # + # Subclasses of the schema will use `trace_class` as a base class for this mode and those + # subclass also will _not_ receive default tracing modules. + # + # @param mode_name [Symbol] + # @param trace_class [Class] subclass of GraphQL::Tracing::Trace + # @return void + # + # pkg:gem/graphql#lib/graphql/schema.rb:203 + def trace_mode(mode_name, trace_class); end + + # @return [Array] Modules added for tracing in `trace_mode`, including inherited ones + # + # pkg:gem/graphql#lib/graphql/schema.rb:245 + def trace_modules_for(trace_mode); end + + # The options hash for this trace mode + # @return [Hash] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1500 + def trace_options_for(mode); end + + # Mix `trace_mod` into this schema's `Trace` class so that its methods will be called at runtime. + # + # You can attach a module to run in only _some_ circumstances by using `mode:`. When a module is added with `mode:`, + # it will only run for queries with a matching `context[:trace_mode]`. + # + # Any custom trace modes _also_ include the default `trace_with ...` modules (that is, those added _without_ any particular `mode: ...` configuration). + # + # @example Adding a trace in a special mode + # # only runs when `query.context[:trace_mode]` is `:special` + # trace_with SpecialTrace, mode: :special + # + # @param trace_mod [Module] A module that implements tracing methods + # @param mode [Symbol] Trace module will only be used for this trade mode + # @param options [Hash] Keywords that will be passed to the tracing class during `#initialize` + # @return [void] + # @see GraphQL::Tracing::Trace Tracing::Trace for available tracing methods + # + # pkg:gem/graphql#lib/graphql/schema.rb:1470 + def trace_with(trace_mod, mode: T.unsafe(nil), **options); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1428 + def tracer(new_tracer, silence_deprecation_warning: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1441 + def tracers; end + + # Called at runtime when GraphQL-Ruby encounters a mismatch between the application behavior + # and the GraphQL type system. + # + # The default implementation of this method is to follow the GraphQL specification, + # but you can override this to report errors to your bug tracker or customize error handling. + # @param type_error [GraphQL::Error] several specific error classes are passed here, see the default implementation for details + # @param context [GraphQL::Query::Context] the context for the currently-running operation + # @return [void] + # @raise [GraphQL::ExecutionError] to return this error to the client + # @raise [GraphQL::Error] to crash the query and raise a developer-facing error + # + # pkg:gem/graphql#lib/graphql/schema.rb:1333 + def type_error(type_error, context); end + + # pkg:gem/graphql#lib/graphql/schema.rb:706 + def type_from_ast(ast_node, context: T.unsafe(nil)); end + + # Build a map of `{ name => type }` and return it + # @return [Hash Class>] A dictionary of type classes by their GraphQL name + # @see get_type Which is more efficient for finding _one type_ by name, because it doesn't merge hashes. + # + # pkg:gem/graphql#lib/graphql/schema.rb:342 + def types(context = T.unsafe(nil)); end + + # This hook is called when a field fails an `authorized?` check. + # + # By default, this hook implements the same behavior as unauthorized_object. + # + # Whatever value is returned from this method will be used instead of the + # unauthorized field . If an error is raised, then `nil` will be used. + # + # If you want to add an error to the `"errors"` key, raise a {GraphQL::ExecutionError} + # in this hook. + # + # @param unauthorized_error [GraphQL::UnauthorizedFieldError] + # @return [Field] The returned field will be put in the GraphQL response + # + # pkg:gem/graphql#lib/graphql/schema.rb:1319 + def unauthorized_field(unauthorized_error); end + + # This hook is called when an object fails an `authorized?` check. + # You might report to your bug tracker here, so you can correct + # the field resolvers not to return unauthorized objects. + # + # By default, this hook just replaces the unauthorized object with `nil`. + # + # Whatever value is returned from this method will be used instead of the + # unauthorized object (accessible as `unauthorized_error.object`). If an + # error is raised, then `nil` will be used. + # + # If you want to add an error to the `"errors"` key, raise a {GraphQL::ExecutionError} + # in this hook. + # + # @param unauthorized_error [GraphQL::UnauthorizedError] + # @return [Object] The returned object will be put in the GraphQL response + # + # pkg:gem/graphql#lib/graphql/schema.rb:1303 + def unauthorized_object(unauthorized_error); end + + # pkg:gem/graphql#lib/graphql/schema.rb:662 + def union_memberships(type = T.unsafe(nil)); end + + # Add `plugin` to this schema + # @param plugin [#use] A Schema plugin + # @return void + # + # pkg:gem/graphql#lib/graphql/schema.rb:320 + def use(plugin, **kwargs); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:607 + def use_visibility_profile=(_arg0); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:611 + def use_visibility_profile?; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1150 + def using_backtrace; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:1150 + def using_backtrace=(_arg0); end + + # Validate a query string according to this schema. + # @param string_or_document [String, GraphQL::Language::Nodes::Document] + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/schema.rb:861 + def validate(string_or_document, rules: T.unsafe(nil), context: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:886 + def validate_max_errors(new_validate_max_errors = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:884 + def validate_max_errors=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema.rb:848 + def validate_timeout(new_validate_timeout = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema.rb:846 + def validate_timeout=(_arg0); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:609 + def visibility; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:609 + def visibility=(_arg0); end + + # @api private + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:596 + def visibility_profile_class; end + + # @api private + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:607 + def visibility_profile_class=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema.rb:1271 + def visible?(member, ctx); end + + # @api private + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:582 + def warden_class; end + + # @api private + # @api private + # + # pkg:gem/graphql#lib/graphql/schema.rb:593 + def warden_class=(_arg0); end + + private + + # pkg:gem/graphql#lib/graphql/schema.rb:1935 + def add_trace_options_for(mode, new_options); end + + # @param t [Module, Array] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema.rb:1952 + def add_type_and_traverse(t, root:); end + + # This is overridden in subclasses to check the inheritance chain + # + # pkg:gem/graphql#lib/graphql/schema.rb:2067 + def get_references_to(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema.rb:2004 + def lazy_methods; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2026 + def non_introspection_types; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2046 + def own_directives; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2050 + def own_instrumenters; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2062 + def own_multiplex_analyzers; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2034 + def own_orphan_types; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2030 + def own_plugins; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2038 + def own_possible_types; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2058 + def own_query_analyzers; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2022 + def own_references_to; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2054 + def own_tracers; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2018 + def own_types; end + + # pkg:gem/graphql#lib/graphql/schema.rb:2042 + def own_union_memberships; end + end +end + +# pkg:gem/graphql#lib/graphql/schema/addition.rb:5 +class GraphQL::Schema::Addition + # pkg:gem/graphql#lib/graphql/schema/addition.rb:8 + def initialize(schema:, own_types:, new_types:); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def arguments_with_default_values; end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def possible_types; end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def references; end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def types; end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:6 + def union_memberships; end + + private + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:42 + def add_directives_from(owner); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:152 + def add_type(type, owner:, late_types:, path:); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:50 + def add_type_and_traverse(new_types); end + + # Lookup using `own_types` here because it's ok to override + # inherited types by name + # + # pkg:gem/graphql#lib/graphql/schema/addition.rb:38 + def get_local_type(name); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:26 + def get_type(name); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:22 + def references_to(thing, from:); end + + # pkg:gem/graphql#lib/graphql/schema/addition.rb:91 + def update_type_owner(owner, type); end +end + +# pkg:gem/graphql#lib/graphql/schema/always_visible.rb:4 +module GraphQL::Schema::AlwaysVisible + # pkg:gem/graphql#lib/graphql/schema/always_visible.rb:10 + def visible?(_member, _context); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/always_visible.rb:5 + def use(schema, **opts); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/argument.rb:4 +class GraphQL::Schema::Argument + include ::GraphQL::Schema::Member::HasPath + include ::GraphQL::Schema::Member::HasAstNode + include ::GraphQL::Schema::Member::HasAuthorization + include ::GraphQL::Schema::Member::HasAuthorization::InstanceConfigured + include ::GraphQL::Schema::Member::HasDirectives + include ::GraphQL::Schema::Member::HasDeprecationReason + include ::GraphQL::EmptyObjects + include ::GraphQL::Schema::Member::HasValidators + + # @param arg_name [Symbol] + # @param type_expr + # @param desc [String] + # @param type [Class, Array] Input type; positional argument also accepted + # @param name [Symbol] positional argument also accepted # @param loads [Class, Array] A GraphQL type to load for the given ID when one is present + # @param definition_block [Proc] Called with the newly-created {Argument} + # @param owner [Class] Private, used by GraphQL-Ruby during schema definition + # @param required [Boolean, :nullable] if true, this argument is non-null; if false, this argument is nullable. If `:nullable`, then the argument must be provided, though it may be `null`. + # @param description [String] + # @param default_value [Object] + # @param loads [Class, Array] A GraphQL type to load for the given ID when one is present + # @param as [Symbol] Override the keyword name when passed to a method + # @param prepare [Symbol] A method to call to transform this argument's valuebefore sending it to field resolution + # @param camelize [Boolean] if true, the name will be camelized when building the schema + # @param from_resolver [Boolean] if true, a Resolver class defined this argument + # @param directives [Hash{Class => Hash}] + # @param deprecation_reason [String] + # @param validates [Hash, nil] Options for building validators, if any should be applied + # @param replace_null_with_default [Boolean] if `true`, incoming values of `null` will be replaced with the configured `default_value` + # @param comment [String] Private, used by GraphQL-Ruby when parsing GraphQL schema files + # @param ast_node [GraphQL::Language::Nodes::InputValueDefinition] Private, used by GraphQL-Ruby when parsing schema files + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:61 + def initialize(arg_name = T.unsafe(nil), type_expr = T.unsafe(nil), desc = T.unsafe(nil), owner:, required: T.unsafe(nil), type: T.unsafe(nil), name: T.unsafe(nil), loads: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), ast_node: T.unsafe(nil), default_value: T.unsafe(nil), as: T.unsafe(nil), from_resolver: T.unsafe(nil), camelize: T.unsafe(nil), prepare: T.unsafe(nil), validates: T.unsafe(nil), directives: T.unsafe(nil), deprecation_reason: T.unsafe(nil), replace_null_with_default: T.unsafe(nil), &definition_block); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:172 + def authorized?(obj, value, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:176 + def authorized_as_type?(obj, value, ctx, as_type:); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:168 + def authorizes?(context); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:267 + def coerce_into_values(parent_object, values, context, argument_values); end + + # @return [String] Comment for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:142 + def comment(text = T.unsafe(nil)); end + + # @return [String] Comment for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:139 + def comment=(_arg0); end + + # @param default_value [Object] The value to use when the client doesn't provide one + # @return [Object] the value used when the client doesn't provide a value for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:112 + def default_value(new_default_value = T.unsafe(nil)); end + + # @return [Boolean] True if this argument has a default value + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:120 + def default_value?; end + + # @return [String] Deprecation reason for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:151 + def deprecation_reason(text = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:159 + def deprecation_reason=(new_reason); end + + # @return [String] Documentation for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:131 + def description(text = T.unsafe(nil)); end + + # @return [String] Documentation for this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:128 + def description=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:227 + def freeze; end + + # @return [Boolean] true if a resolver defined this argument + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:36 + def from_resolver?; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:15 + def graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:106 + def inspect; end + + # @return [Symbol] This argument's name in Ruby keyword arguments + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:30 + def keyword; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:328 + def load_and_authorize_value(load_method_owner, coerced_value, context); end + + # @return [Class, Module, nil] If this argument should load an application object, this is the type of object to load + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:33 + def loads; end + + # @return [String] the GraphQL name for this argument, camelized unless `camelize: false` is provided + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:14 + def name; end + + # @return [GraphQL::Schema::Field, Class] The field or input object this argument belongs to + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:18 + def owner; end + + # @param new_prepare [Method, Proc] + # @return [Symbol] A method or proc to call to transform this value before sending it to field resolution method + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:22 + def prepare(new_prepare = T.unsafe(nil)); end + + # Apply the {prepare} configuration to `value`, using methods from `obj`. + # Used by the runtime. + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:235 + def prepare_value(obj, value, context: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:124 + def replace_null_with_default?; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:221 + def statically_coercible?; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:209 + def type; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:199 + def type=(new_type); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/argument.rb:381 + def validate_default_value; end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:164 + def visible?(context); end + + private + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:418 + def recursively_prepare_input_object(value, type, context); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:446 + def validate_deprecated_or_optional(null:, deprecation_reason:); end + + # pkg:gem/graphql#lib/graphql/schema/argument.rb:434 + def validate_input_type(input_type); end +end + +# pkg:gem/graphql#lib/graphql/schema/argument.rb:409 +class GraphQL::Schema::Argument::InvalidDefaultValueError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/argument.rb:410 + def initialize(argument); end +end + +# pkg:gem/graphql#lib/graphql/schema/built_in_types.rb:4 +GraphQL::Schema::BUILT_IN_TYPES = T.let(T.unsafe(nil), Hash) + +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/base_64_encoder.rb:6 +module GraphQL::Schema::Base64Encoder + class << self + # pkg:gem/graphql#lib/graphql/schema/base_64_encoder.rb:11 + def decode(encoded_text, nonce: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/base_64_encoder.rb:7 + def encode(unencoded_text, nonce: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb:4 +module GraphQL::Schema::BuildFromDefinition + class << self + # @see {Schema.from_definition} + # + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:9 + def from_definition(schema_superclass, definition_string, parser: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:16 + def from_definition_path(schema_superclass, definition_path, parser: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:23 + def from_document(schema_superclass, document, default_resolve:, using: T.unsafe(nil), base_types: T.unsafe(nil), relay: T.unsafe(nil)); end + end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:29 +module GraphQL::Schema::BuildFromDefinition::Builder + include ::GraphQL::EmptyObjects + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Schema::BuildFromDefinition::Builder + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:328 + def args_to_kwargs(arg_owner, node); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:33 + def build(schema_superclass, document, default_resolve:, relay:, using: T.unsafe(nil), base_types: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:458 + def build_arguments(type_class, arguments, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:443 + def build_default_value(default_value); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:265 + def build_definition_from_node(definition, type_resolver, default_resolve, base_types); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:369 + def build_deprecation_reason(directives); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:482 + def build_directive(directive_definition, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:298 + def build_directives(definition, ast_node, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:346 + def build_enum_type(enum_type_definition, type_resolver, base_type); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:508 + def build_fields(owner, field_definitions, type_resolver, default_resolve:); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:432 + def build_input_object_type(input_object_type_definition, type_resolver, base_type); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:494 + def build_interface_type(interface_type_definition, type_resolver, base_type); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:426 + def build_interfaces(type_class, interface_names, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:413 + def build_object_type(object_type_definition, type_resolver, base_type); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:550 + def build_resolve_type(lookup_hash, directives, missing_type_handler); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:379 + def build_scalar_type(scalar_type_definition, type_resolver, base_type, default_resolve:); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:396 + def build_scalar_type_coerce_method(scalar_class, method_name, default_definition_resolve); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:402 + def build_union_type(union_type_definition, type_resolver, base_type); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:357 + def build_values(type_class, enum_value_definitions, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:537 + def define_field_resolve_method(owner, method_name, field_name); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:310 + def prepare_directives(ast_node, type_resolver); end + + # Modify `types`, replacing any late-bound references to built-in types + # with their actual definitions. + # + # (Schema definitions are allowed to reference those built-ins without redefining them.) + # @return void + # + # pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:289 + def replace_late_bound_types_with_built_in(types); end +end + +# pkg:gem/graphql#lib/graphql/schema/build_from_definition.rb:261 +GraphQL::Schema::BuildFromDefinition::Builder::NullResolveType = T.let(T.unsafe(nil), Proc) + +# Wrap a user-provided hash of resolution behavior for easy access at runtime. +# +# Coerce scalar values by: +# - Checking for a function in the map like `{ Date: { coerce_input: ->(val, ctx) { ... }, coerce_result: ->(val, ctx) { ... } } }` +# - Falling back to a passthrough +# +# Interface/union resolution can be provided as a `resolve_type:` key. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb:5 +class GraphQL::Schema::BuildFromDefinition::ResolveMap + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:23 + def initialize(user_resolve_hash); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:63 + def call(type, field, obj, args, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:68 + def coerce_input(type, value, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:72 + def coerce_result(type, value, ctx); end +end + +# pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb:6 +class GraphQL::Schema::BuildFromDefinition::ResolveMap::DefaultResolve + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb:7 + def initialize(field_map, field_name); end + + # Make some runtime checks about + # how `obj` implements the `field_name`. + # + # Create a new resolve function according to that implementation, then: + # - update `field_map` with this implementation + # - call the implementation now (to satisfy this field execution) + # + # If `obj` doesn't implement `field_name`, raise an error. + # + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb:20 + def call(obj, args, ctx); end +end + +# pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:17 +module GraphQL::Schema::BuildFromDefinition::ResolveMap::NullScalarCoerce + class << self + # pkg:gem/graphql#lib/graphql/schema/build_from_definition/resolve_map.rb:18 + def call(val, _ctx); end + end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/schema.rb:2092 +module GraphQL::Schema::DefaultTraceClass; end + +# Subclasses of this can influence how {GraphQL::Execution::Interpreter} runs queries. +# +# - {.include?}: if it returns `false`, the field or fragment will be skipped altogether, as if it were absent +# - {.resolve}: Wraps field resolution (so it should call `yield` to continue) +# +# pkg:gem/graphql#lib/graphql/schema/directive.rb:9 +class GraphQL::Schema::Directive < ::GraphQL::Schema::Member + include ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + extend ::GraphQL::Schema::Member::HasArguments + extend ::GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured + extend ::GraphQL::Schema::Member::HasArguments::HasDirectiveArguments + extend ::GraphQL::Schema::Member::HasValidators + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:134 + def initialize(owner, **arguments); end + + # @return [GraphQL::Interpreter::Arguments] + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:129 + def arguments; end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:187 + def graphql_name; end + + # @return [GraphQL::Schema::Field, GraphQL::Schema::Argument, Class, Module] + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:126 + def owner; end + + private + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:277 + def assert_has_location(location); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:240 + def assert_valid_owner; end + + class << self + # pkg:gem/graphql#lib/graphql/schema/directive.rb:53 + def default_directive(new_default_directive = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:63 + def default_directive?; end + + # Return a name based on the class name, + # but downcase the first letter. + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:24 + def default_graphql_name; end + + # If false, this part of the query won't be evaluated + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:68 + def include?(_object, arguments, context); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:32 + def locations(*new_locations); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:91 + def on_field?; end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:95 + def on_fragment?; end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:99 + def on_operation?; end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:18 + def path; end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:107 + def repeatable(new_value); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:103 + def repeatable?; end + + # Continuing is passed as a block; `yield` to continue + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:78 + def resolve(object, arguments, context); end + + # Continuing is passed as a block, yield to continue. + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:83 + def resolve_each(object, arguments, context); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:49 + def runtime?; end + + # Determines whether {Execution::Lookahead} considers the field to be selected + # + # pkg:gem/graphql#lib/graphql/schema/directive.rb:73 + def static_include?(_arguments, _context); end + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:87 + def validate!(arguments, context); end + + private + + # pkg:gem/graphql#lib/graphql/schema/directive.rb:113 + def inherited(subclass); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:206 +GraphQL::Schema::Directive::ARGUMENT_DEFINITION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:215 +GraphQL::Schema::Directive::DEFAULT_DEPRECATION_REASON = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/schema/directive/deprecated.rb:5 +class GraphQL::Schema::Directive::Deprecated < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:209 +GraphQL::Schema::Directive::ENUM = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:210 +GraphQL::Schema::Directive::ENUM_VALUE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:196 +GraphQL::Schema::Directive::FIELD = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:205 +GraphQL::Schema::Directive::FIELD_DEFINITION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:197 +GraphQL::Schema::Directive::FRAGMENT_DEFINITION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:198 +GraphQL::Schema::Directive::FRAGMENT_SPREAD = T.let(T.unsafe(nil), Symbol) + +# An example directive to show how you might interact with the runtime. +# +# This directive might be used along with a server-side feature flag system like Flipper. +# +# With that system, you could use this directive to exclude parts of a query +# if the current viewer doesn't have certain flags enabled. +# (So, this flag would be for internal clients, like your iOS app, not third-party API clients.) +# +# To use it, you have to implement `.enabled?`, for example: +# +# @example Implementing the Feature directive +# # app/graphql/directives/feature.rb +# class Directives::Feature < GraphQL::Schema::Directive::Feature +# def self.enabled?(flag_name, _obj, context) +# # Translate some GraphQL data for Ruby: +# flag_key = flag_name.underscore +# current_user = context[:viewer] +# # Check the feature flag however your app does it: +# MyFeatureFlags.enabled?(current_user, flag_key) +# end +# end +# +# @example Flagging a part of the query +# viewer { +# # This field only runs if `.enabled?("recommendationEngine", obj, context)` +# # returns true. Otherwise, it's treated as if it didn't exist. +# recommendations @feature(flag: "recommendationEngine") { +# name +# rating +# } +# } +# +# pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:36 +class GraphQL::Schema::Directive::Feature < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + class << self + # Override this method in your app's subclass of this directive. + # + # @param flag_name [String] The client-provided string of a feature to check + # @param object [GraphQL::Schema::Objct] The currently-evaluated GraphQL object instance + # @param context [GraphQL::Query::Context] + # @return [Boolean] If truthy, execution will continue + # + # pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:60 + def enabled?(flag_name, object, context); end + + # Implement the Directive API + # + # pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:49 + def include?(object, arguments, context); end + + # pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:64 + def resolve_field(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:65 + def resolve_fragment_spread(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/directive/feature.rb:66 + def resolve_inline_fragment(*_arg0, **_arg1, &_arg2); end + end +end + +# This is _similar_ to {Directive::Feature}, except it's prescribed by the server, not the client. +# +# In this case, the server hides types and fields _entirely_, unless the current context has certain `:flags` present. +# +# pkg:gem/graphql#lib/graphql/schema/directive/flagged.rb:8 +class GraphQL::Schema::Directive::Flagged < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + # pkg:gem/graphql#lib/graphql/schema/directive/flagged.rb:9 + def initialize(target, **options); end +end + +# pkg:gem/graphql#lib/graphql/schema/directive/flagged.rb:42 +module GraphQL::Schema::Directive::Flagged::VisibleByFlag + # pkg:gem/graphql#lib/graphql/schema/directive/flagged.rb:47 + def visible?(context); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/directive/flagged.rb:43 + def included(schema_class); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:199 +GraphQL::Schema::Directive::INLINE_FRAGMENT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:212 +GraphQL::Schema::Directive::INPUT_FIELD_DEFINITION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:211 +GraphQL::Schema::Directive::INPUT_OBJECT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:207 +GraphQL::Schema::Directive::INTERFACE = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive/include.rb:5 +class GraphQL::Schema::Directive::Include < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + class << self + # pkg:gem/graphql#lib/graphql/schema/directive/include.rb:19 + def static_include?(args, ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:131 +class GraphQL::Schema::Directive::InvalidArgumentError < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:191 +GraphQL::Schema::Directive::LOCATIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:216 +GraphQL::Schema::Directive::LOCATION_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:194 +GraphQL::Schema::Directive::MUTATION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:204 +GraphQL::Schema::Directive::OBJECT = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive/one_of.rb:5 +class GraphQL::Schema::Directive::OneOf < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + # pkg:gem/graphql#lib/graphql/schema/directive/one_of.rb:10 + def initialize(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/graphql#lib/graphql/schema/directive/one_of.rb:16 +module GraphQL::Schema::Directive::OneOf::IsOneOf + # pkg:gem/graphql#lib/graphql/schema/directive/one_of.rb:17 + def one_of?; end +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:193 +GraphQL::Schema::Directive::QUERY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:192 +GraphQL::Schema::Directive::RUNTIME_LOCATIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:203 +GraphQL::Schema::Directive::SCALAR = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:202 +GraphQL::Schema::Directive::SCHEMA = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:195 +GraphQL::Schema::Directive::SUBSCRIPTION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive/skip.rb:5 +class GraphQL::Schema::Directive::Skip < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + class << self + # pkg:gem/graphql#lib/graphql/schema/directive/skip.rb:19 + def static_include?(args, ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/directive/specified_by.rb:5 +class GraphQL::Schema::Directive::SpecifiedBy < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators +end + +# An example directive to show how you might interact with the runtime. +# +# This directive takes the return value of the tagged part of the query, +# and if the named transform is whitelisted and applies to the return value, +# it's applied by calling a method with that name. +# +# @example Installing the directive +# class MySchema < GraphQL::Schema +# directive(GraphQL::Schema::Directive::Transform) +# end +# +# @example Transforming strings +# viewer { +# username @transform(by: "upcase") +# } +# +# pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:20 +class GraphQL::Schema::Directive::Transform < ::GraphQL::Schema::Directive + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + class << self + # Implement the Directive API + # + # pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:36 + def resolve(object, arguments, context); end + + # pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:58 + def resolve_field(ast_nodes, parent_type, field_defn, objects, arguments, context); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:30 +GraphQL::Schema::Directive::Transform::TRANSFORMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:67 +class GraphQL::Schema::Directive::Transform::Transformer + include ::GraphQL::Execution::PostProcessor + + # pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:69 + def initialize(transform); end + + # pkg:gem/graphql#lib/graphql/schema/directive/transform.rb:72 + def after_resolve(field_results); end +end + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:208 +GraphQL::Schema::Directive::UNION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema/directive.rb:200 +GraphQL::Schema::Directive::VARIABLE_DEFINITION = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/schema.rb:80 +class GraphQL::Schema::DuplicateNamesError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema.rb:82 + def initialize(duplicated_name:, duplicated_definition_1:, duplicated_definition_2:); end + + # pkg:gem/graphql#lib/graphql/schema.rb:81 + def duplicated_name; end +end + +# Extend this class to define GraphQL enums in your schema. +# +# By default, GraphQL enum values are translated into Ruby strings. +# You can provide a custom value with the `value:` keyword. +# +# @example +# # equivalent to +# # enum PizzaTopping { +# # MUSHROOMS +# # ONIONS +# # PEPPERS +# # } +# class PizzaTopping < GraphQL::Schema::Enum +# value :MUSHROOMS +# value :ONIONS +# value :PEPPERS +# end +# +# pkg:gem/graphql#lib/graphql/schema/enum.rb:22 +class GraphQL::Schema::Enum < ::GraphQL::Schema::Member + extend ::GraphQL::Schema::Member::ValidatesInput + + class << self + # @return [Array] An unfiltered list of all definitions + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:130 + def all_enum_value_definitions; end + + # Called by the runtime with incoming string representations from a query. + # It will match the string to a configured by name or by Ruby value. + # @param value_name [String, Object] A string from a GraphQL query, or a Ruby value matching a `value(..., value: ...)` configuration + # @param ctx [GraphQL::Query::Context] + # @raise [GraphQL::UnauthorizedEnumValueError] if an {EnumValue} matches but returns false for `.authorized?`. Goes to {Schema.unauthorized_object}. + # @return [Object] The Ruby value for the matched {GraphQL::Schema::EnumValue} + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:216 + def coerce_input(value_name, ctx); end + + # Called by the runtime when a field returns a value to give back to the client. + # This method checks that the incoming {value} matches one of the enum's defined values. + # @param value [Object] Any value matching the values for this enum. + # @param ctx [GraphQL::Query::Context] + # @raise [GraphQL::Schema::Enum::UnresolvedValueError] if {value} doesn't match a configured value or if the matching value isn't authorized. + # @return [String] The GraphQL-ready string for {value} + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:199 + def coerce_result(value, ctx); end + + # @return [Class] for handling `value(...)` inputs and building `GraphQL::Enum::EnumValue`s out of them + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:154 + def enum_value_class(new_enum_value_class = T.unsafe(nil)); end + + # @return [Array] Possible values of this enum + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:93 + def enum_values(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:231 + def inherited(child_class); end + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:176 + def kind; end + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:180 + def validate_non_null_input(value_name, ctx, max_errors: T.unsafe(nil)); end + + # Define a value for this enum + # @option kwargs [String, Symbol] :graphql_name the GraphQL value for this, usually `SCREAMING_CASE` + # @option kwargs [String] :description, the GraphQL description for this value, present in documentation + # @option kwargs [String] :comment, the GraphQL comment for this value, present in documentation + # @option kwargs [::Object] :value the translated Ruby value for this object (defaults to `graphql_name`) + # @option kwargs [::Object] :value_method, the method name to fetch `graphql_name` (defaults to `graphql_name.downcase`) + # @option kwargs [String] :deprecation_reason if this object is deprecated, include a message here + # @param value_method [Symbol, false] A method to generate for this value, or `false` to skip generation + # @return [void] + # @see {Schema::EnumValue} which handles these inputs by default + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:69 + def value(*args, value_method: T.unsafe(nil), **kwargs, &block); end + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:164 + def value_methods(new_value = T.unsafe(nil)); end + + # @return [Hash GraphQL::Schema::EnumValue>] Possible values of this enum, keyed by name. + # + # pkg:gem/graphql#lib/graphql/schema/enum.rb:149 + def values(context = T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:247 + def generate_value_method(value, configured_value_method); end + + # pkg:gem/graphql#lib/graphql/schema/enum.rb:243 + def own_values; end + end +end + +# Raised when a {GraphQL::Schema::Enum} is defined to have no values. +# This can also happen when all values return false for `.visible?`. +# +# pkg:gem/graphql#lib/graphql/schema/enum.rb:51 +class GraphQL::Schema::Enum::MissingValuesError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/enum.rb:52 + def initialize(enum_type); end +end + +# This is raised when either: +# +# - A resolver returns a value which doesn't match any of the enum's configured values; +# - Or, the resolver returns a value which matches a value, but that value's `authorized?` check returns false. +# +# In either case, the field should be modified so that the invalid value isn't returned. +# +# {GraphQL::Schema::Enum} subclasses get their own subclass of this error, so that bug trackers can better show where they came from. +# +# pkg:gem/graphql#lib/graphql/schema/enum.rb:33 +class GraphQL::Schema::Enum::UnresolvedValueError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/enum.rb:34 + def initialize(value:, enum:, context:, authorized:); end +end + +# A possible value for an {Enum}. +# +# You can extend this class to customize enum values in your schema. +# +# @example custom enum value class +# # define a custom class: +# class CustomEnumValue < GraphQL::Schema::EnumValue +# def initialize(*args) +# # arguments to `value(...)` in Enum classes are passed here +# super +# end +# end +# +# class BaseEnum < GraphQL::Schema::Enum +# # use it for these enums: +# enum_value_class CustomEnumValue +# end +# +# pkg:gem/graphql#lib/graphql/schema/enum_value.rb:22 +class GraphQL::Schema::EnumValue < ::GraphQL::Schema::Member + include ::GraphQL::Schema::Member::HasPath + include ::GraphQL::Schema::Member::HasAstNode + include ::GraphQL::Schema::Member::HasDirectives + include ::GraphQL::Schema::Member::HasDeprecationReason + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:33 + def initialize(graphql_name, desc = T.unsafe(nil), owner:, ast_node: T.unsafe(nil), directives: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), value: T.unsafe(nil), deprecation_reason: T.unsafe(nil), &block); end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:81 + def authorized?(_ctx); end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:62 + def comment(new_comment = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:55 + def description(new_desc = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:28 + def graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:76 + def inspect; end + + # @return [Class] The enum type that owns this value + # + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:31 + def owner; end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:69 + def value(new_val = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/enum_value.rb:80 + def visible?(_ctx); end +end + +# pkg:gem/graphql#lib/graphql/schema/field/connection_extension.rb:5 +class GraphQL::Schema::Field + include ::GraphQL::Schema::Member::HasArguments + include ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + include ::GraphQL::Schema::Member::HasArguments::FieldConfigured + include ::GraphQL::Schema::Member::HasAstNode + include ::GraphQL::Schema::Member::HasAuthorization + include ::GraphQL::Schema::Member::HasAuthorization::InstanceConfigured + include ::GraphQL::Schema::Member::HasPath + include ::GraphQL::EmptyObjects + include ::GraphQL::Schema::Member::HasValidators + include ::GraphQL::Schema::Member::HasDirectives + include ::GraphQL::Schema::Member::HasDeprecationReason + extend ::GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + + # @param name [Symbol] The underscore-cased version of this field name (will be camelized for the GraphQL API) + # @param type [Class, GraphQL::BaseType, Array] The return type of this field + # @param owner [Class] The type that this field belongs to + # @param null [Boolean] (defaults to `true`) `true` if this field may return `null`, `false` if it is never `null` + # @param description [String] Field description + # @param comment [String] Field comment + # @param deprecation_reason [String] If present, the field is marked "deprecated" with this message + # @param method [Symbol] The method to call on the underlying object to resolve this field (defaults to `name`) + # @param hash_key [String, Symbol] The hash key to lookup on the underlying object (if its a Hash) to resolve this field (defaults to `name` or `name.to_s`) + # @param dig [Array] The nested hash keys to lookup on the underlying hash to resolve this field using dig + # @param resolver_method [Symbol] The method on the type to call to resolve this field (defaults to `name`) + # @param connection [Boolean] `true` if this field should get automagic connection behavior; default is to infer by `*Connection` in the return type name + # @param connection_extension [Class] The extension to add, to implement connections. If `nil`, no extension is added. + # @param resolve_static [Symbol, true, nil] Used by {Schema.execute_next} to produce a single value, shared by all objects which resolve this field. Called on the owner type class with `context, **arguments` + # @param resolve_batch [Symbol, true, nil] Used by {Schema.execute_next} map `objects` to a same-sized Array of results. Called on the owner type class with `objects, context, **arguments`. + # @param resolve_each [Symbol, true, nil] Used by {Schema.execute_next} to get a value value for each item. Called on the owner type class with `object, context, **arguments`. + # @param resolve_legacy_instance_method [Symbol, true, nil] Used by {Schema.execute_next} to get a value value for each item. Calls an instance method on the object type class. + # @param dataload [Class, Hash] Shorthand for making dataloader calls + # @param max_page_size [Integer, nil] For connections, the maximum number of items to return from this field, or `nil` to allow unlimited results. + # @param default_page_size [Integer, nil] For connections, the default number of items to return from this field, or `nil` to return unlimited results. + # @param introspection [Boolean] If true, this field will be marked as `#introspection?` and the name may begin with `__` + # @param resolver_class [Class] (Private) A {Schema::Resolver} which this field was derived from. Use `resolver:` to create a field with a resolver. + # @param arguments [{String=>GraphQL::Schema::Argument, Hash}] Arguments for this field (may be added in the block, also) + # @param camelize [Boolean] If true, the field name will be camelized when building the schema + # @param complexity [Numeric] When provided, set the complexity for this field + # @param scope [Boolean] If true, the return type's `.scope_items` method will be called on the return value + # @param subscription_scope [Symbol, String] A key in `context` which will be used to scope subscription payloads + # @param extensions [Array Object>>] Named extensions to apply to this field (see also {#extension}) + # @param directives [Hash{Class => Hash}] Directives to apply to this field + # @param trace [Boolean] If true, a {GraphQL::Tracing} tracer will measure this scalar field + # @param broadcastable [Boolean] Whether or not this field can be distributed in subscription broadcasts + # @param ast_node [Language::Nodes::FieldDefinition, nil] If this schema was parsed from definition, this AST node defined the field + # @param method_conflict_warning [Boolean] If false, skip the warning if this field's method conflicts with a built-in method + # @param validates [Array] Configurations for validating this field + # @param fallback_value [Object] A fallback value if the method is not defined + # @param dynamic_introspection [Boolean] (Private, used by GraphQL-Ruby) + # @param relay_node_field [Boolean] (Private, used by GraphQL-Ruby) + # @param relay_nodes_field [Boolean] (Private, used by GraphQL-Ruby) + # @param extras [Array<:ast_node, :parent, :lookahead, :owner, :execution_errors, :graphql_name, :argument_details, Symbol>] Extra arguments to be injected into the resolver for this field + # @param definition_block [Proc] an additional block for configuring the field. Receive the field as a block param, or, if no block params are defined, then the block is `instance_eval`'d on the new {Field}. + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:223 + def initialize(type: T.unsafe(nil), name: T.unsafe(nil), owner: T.unsafe(nil), null: T.unsafe(nil), description: T.unsafe(nil), comment: T.unsafe(nil), deprecation_reason: T.unsafe(nil), method: T.unsafe(nil), resolve_legacy_instance_method: T.unsafe(nil), resolve_static: T.unsafe(nil), resolve_each: T.unsafe(nil), resolve_batch: T.unsafe(nil), hash_key: T.unsafe(nil), dig: T.unsafe(nil), resolver_method: T.unsafe(nil), connection: T.unsafe(nil), max_page_size: T.unsafe(nil), default_page_size: T.unsafe(nil), scope: T.unsafe(nil), introspection: T.unsafe(nil), camelize: T.unsafe(nil), trace: T.unsafe(nil), complexity: T.unsafe(nil), dataload: T.unsafe(nil), ast_node: T.unsafe(nil), extras: T.unsafe(nil), extensions: T.unsafe(nil), connection_extension: T.unsafe(nil), resolver_class: T.unsafe(nil), subscription_scope: T.unsafe(nil), relay_node_field: T.unsafe(nil), relay_nodes_field: T.unsafe(nil), method_conflict_warning: T.unsafe(nil), broadcastable: T.unsafe(nil), arguments: T.unsafe(nil), directives: T.unsafe(nil), validates: T.unsafe(nil), fallback_value: T.unsafe(nil), dynamic_introspection: T.unsafe(nil), &definition_block); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:673 + def authorized?(object, args, context); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:667 + def authorizes?(context); end + + # If true, subscription updates with this field can be shared between viewers + # @return [Boolean, nil] + # @see GraphQL::Subscriptions::BroadcastAnalyzer + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:398 + def broadcastable?; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:511 + def calculate_complexity(query:, nodes:, child_complexity:); end + + # @param text [String] + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:424 + def comment(text = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:561 + def complexity(new_complexity = T.unsafe(nil)); end + + # Can be set with `connection: true|false` or inferred from a type name ending in `*Connection` + # @return [Boolean] if true, this field will be wrapped with Relay connection behavior + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:115 + def connection?; end + + # @return [Integer, nil] Applied to connections if {#has_default_page_size?} + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:607 + def default_page_size; end + + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:46 + def deprecation_reason; end + + # @param text [String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:410 + def description(text = T.unsafe(nil)); end + + # @param text [String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:25 + def description=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:34 + def dig_keys; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:50 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:393 + def dynamic_introspection; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:393 + def dynamic_introspection=(_arg0); end + + # Calls the definition block, if one was given. + # This is deferred so that references to the return type + # can be lazily evaluated, reducing Rails boot time. + # @return [self] + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:379 + def ensure_loaded; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:372 + def execution_mode; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:372 + def execution_mode_key; end + + # Add `extension` to this field, initialized with `options` if provided. + # + # @example adding an extension + # extension(MyExtensionClass) + # + # @example adding an extension with options + # extension(MyExtensionClass, filter: true) + # + # @param extension_class [Class] subclass of {Schema::FieldExtension} + # @param options [Hash] if provided, given as `options:` when initializing `extension`. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:476 + def extension(extension_class, **options); end + + # Read extension instances from this field, + # or add new classes/options to be initialized on this field. + # Extensions are executed in the order they are added. + # + # @example adding an extension + # extensions([MyExtensionClass]) + # + # @example adding multiple extensions + # extensions([MyExtensionClass, AnotherExtensionClass]) + # + # @example adding an extension with options + # extensions([MyExtensionClass, { AnotherExtensionClass => { filter: true } }]) + # + # @param extensions [Array Hash>>] Add extensions to this field. For hash elements, only the first key/value is used. + # @return [Array] extensions to apply to this field + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:451 + def extensions(new_extensions = T.unsafe(nil)); end + + # Read extras (as symbols) from this field, + # or add new extras to be opted into by this field's resolver. + # + # @param new_extras [Array] Add extras to this field + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:493 + def extras(new_extras = T.unsafe(nil)); end + + # @param ctx [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:828 + def fetch_extra(extra_name, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:617 + def freeze; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:23 + def graphql_name; end + + # @return [Boolean] True if this field's {#default_page_size} should override the schema default. + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:602 + def has_default_page_size?; end + + # @return [Boolean] True if this field's {#max_page_size} should override the schema default. + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:586 + def has_max_page_size?; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:33 + def hash_key; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:98 + def inspect; end + + # @return [Boolean] Is this field a predefined introspection field? + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:94 + def introspection?; end + + # @return [Integer, nil] Applied to connections if {#has_max_page_size?} + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:591 + def max_page_size; end + + # @return [Boolean] Should we warn if this field's name conflicts with a built-in method? + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:179 + def method_conflict_warning?; end + + # @return [String] Method or hash key on the underlying object to look up + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:31 + def method_str; end + + # @return [Symbol] Method or hash key on the underlying object to look up + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:28 + def method_sym; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:102 + def mutation; end + + # @return [String] the GraphQL name for this field, camelized unless `camelize: false` is provided + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:22 + def name; end + + # @return [Symbol] the original name of the field, passed in by the user + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:86 + def original_name; end + + # @return [Class] The thing this field was defined on (type, mutation, resolver) + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:72 + def owner; end + + # @return [Class] The thing this field was defined on (type, mutation, resolver) + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:72 + def owner=(_arg0); end + + # @return [Class] The GraphQL type this field belongs to. (For fields defined on mutations, it's the payload type) + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:75 + def owner_type; end + + # @return Boolean + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:174 + def relay_node_field; end + + # @return Boolean + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:176 + def relay_nodes_field; end + + # This method is called by the interpreter for each field. + # You can extend it in your base field classes. + # @param object [GraphQL::Schema::Object] An instance of some type class, wrapping an application object + # @param args [Hash] A symbol-keyed hash of Ruby keyword arguments. (Empty if no args) + # @param ctx [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:722 + def resolve(object, args, query_ctx); end + + # @return [Class, nil] The {Schema::Resolver} this field was derived from, if there is one + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:89 + def resolver; end + + # @return [Symbol] The method on the type to look up + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:37 + def resolver_method; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:929 + def run_next_extensions_before_resolve(objs, args, ctx, extended, idx: T.unsafe(nil), &block); end + + # @return [Boolean] if true, the return type's `.scope_items` method will be applied to this field's return value + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:138 + def scoped?; end + + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:108 + def subscription_scope; end + + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:111 + def subscription_scope=(_arg0); end + + # @return [Boolean] Apply tracing to this field? (Default: skip scalars, this is the override value) + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:105 + def trace; end + + # Get or set the return type of this field. + # + # It may return nil if no type was configured or if the given definition block wasn't called yet. + # @param new_type [Module, GraphQL::Schema::NonNull, GraphQL::Schema::List] A GraphQL return type + # @return [Module, GraphQL::Schema::NonNull, GraphQL::Schema::List, nil] the configured type for this field + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:633 + def type(new_type = T.unsafe(nil)); end + + # Get or set the return type of this field. + # + # It may return nil if no type was configured or if the given definition block wasn't called yet. + # @param new_type [Module, GraphQL::Schema::NonNull, GraphQL::Schema::List] A GraphQL return type + # @return [Module, GraphQL::Schema::NonNull, GraphQL::Schema::List, nil] the configured type for this field + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:626 + def type=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:659 + def visible?(context); end + + private + + # pkg:gem/graphql#lib/graphql/schema/field.rb:977 + def apply_own_complexity_to(child_complexity, query, nodes); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:840 + def assert_satisfactory_implementation(receiver, method_name, ruby_kwargs); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:954 + def run_extensions_before_resolve(obj, args, ctx, extended, idx: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:995 + def set_pagination_extensions(connection_extension:); end + + # Wrap execution with hooks. + # Written iteratively to avoid big stack traces. + # @return [Object] Whatever the + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:894 + def with_extensions(obj, args, ctx); end + + class << self + # This extension is applied to fields when {#connection?} is true. + # + # You can override it in your base field definition. + # @return [Class] A {FieldExtension} subclass for implementing pagination behavior. + # @example Configuring a custom extension + # class Types::BaseField < GraphQL::Schema::Field + # connection_extension(MyCustomExtension) + # end + # + # pkg:gem/graphql#lib/graphql/schema/field.rb:165 + def connection_extension(new_extension_class = T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/field/connection_extension.rb:6 +class GraphQL::Schema::Field::ConnectionExtension < ::GraphQL::Schema::FieldExtension + # pkg:gem/graphql#lib/graphql/schema/field/connection_extension.rb:24 + def after_resolve(value:, object:, arguments:, context:, memo:); end + + # pkg:gem/graphql#lib/graphql/schema/field/connection_extension.rb:7 + def apply; end + + # Remove pagination args before passing it to a user method + # + # pkg:gem/graphql#lib/graphql/schema/field/connection_extension.rb:15 + def resolve(arguments:, context:, object: T.unsafe(nil), objects: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/field.rb:880 +class GraphQL::Schema::Field::ExtendedState + # pkg:gem/graphql#lib/graphql/schema/field.rb:881 + def initialize(args, object); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def added_extras; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def added_extras=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def arguments; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def arguments=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def memos; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def memos=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def object; end + + # pkg:gem/graphql#lib/graphql/schema/field.rb:888 + def object=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/schema/field.rb:19 +class GraphQL::Schema::Field::FieldImplementationFailed < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/schema/field.rb:625 +class GraphQL::Schema::Field::MissingReturnTypeError < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/schema/field/scope_extension.rb:6 +class GraphQL::Schema::Field::ScopeExtension < ::GraphQL::Schema::FieldExtension + # pkg:gem/graphql#lib/graphql/schema/field/scope_extension.rb:7 + def after_resolve(object:, arguments:, context:, value:, memo:); end +end + +# Extend this class to make field-level customizations to resolve behavior. +# +# When a extension is added to a field with `extension(MyExtension)`, a `MyExtension` instance +# is created, and its hooks are applied whenever that field is called. +# +# The instance is frozen so that instance variables aren't modified during query execution, +# which could cause all kinds of issues due to race conditions. +# +# pkg:gem/graphql#lib/graphql/schema/field_extension.rb:11 +class GraphQL::Schema::FieldExtension + # Called when the extension is mounted with `extension(name, options)`. + # The instance will be frozen to avoid improper use of state during execution. + # @param field [GraphQL::Schema::Field] The field where this extension was mounted + # @param options [Object] The second argument to `extension`, or `{}` if nothing was passed. + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:25 + def initialize(field:, options:); end + + # @return [Array, nil] `default_argument`s added, if any were added (otherwise, `nil`) + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:19 + def added_default_arguments; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:117 + def added_extras; end + + # Called after the field's definition block has been executed. + # (Any arguments from the block are present on `field`) + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:88 + def after_define; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:92 + def after_define_apply; end + + # Called after {#field} was resolved, and after any lazy values (like `Promise`s) were synced, + # but before the value was added to the GraphQL response. + # + # Whatever this hook returns will be used as the return value. + # + # @param object [Object] The object the field is being resolved on (not passed by new execution) + # @param objects [Array] The object the field is being resolved on (passed by new execution) + # @param arguments [Hash] Ruby keyword arguments for resolving this field + # @param context [Query::Context] the context for this query + # @param value [Object] Whatever the field previously returned (not passed by new execution) + # @param values [Array] Whatever the field previously returned (passed by new execution) + # @param memo [Object] The third value yielded by {#resolve}, or `nil` if there wasn't one + # @return [Object] The return value for this field. + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:151 + def after_resolve(arguments:, context:, memo:, object: T.unsafe(nil), objects: T.unsafe(nil), values: T.unsafe(nil), value: T.unsafe(nil)); end + + # Called when this extension is attached to a field. + # The field definition may be extended during this method. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:82 + def apply; end + + # @return [GraphQL::Schema::Field] + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:13 + def field; end + + # @return [Object] + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:16 + def options; end + + # Called before resolving {#field}. It should either: + # + # - `yield` values to continue execution; OR + # - return something else to shortcut field execution. + # + # Whatever this method returns will be used for execution. + # + # @param object [Object] The object the field is being resolved on (not passed by new execution) + # @param objects [Array] The objects the field is being resolved on (passed by new execution) + # @param arguments [Hash] Ruby keyword arguments for resolving this field + # @param context [Query::Context] the context for this query + # @yieldparam object_or_objects [Object, Array] The object or objects (new execution) to continue resolving the field on + # @yieldparam arguments [Hash] The keyword arguments to continue resolving with + # @yieldparam memo [Object] Any extension-specific value which will be passed to {#after_resolve} later + # @return [Object] The return value for this field. + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:134 + def resolve(arguments:, context:, object: T.unsafe(nil), objects: T.unsafe(nil)); end + + class << self + # @see Argument#initialize + # @see HasArguments#argument + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:48 + def default_argument(*argument_args, **argument_kwargs); end + + # @return [Array(Array, Hash), nil] A list of default argument configs, or `nil` if there aren't any + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:34 + def default_argument_configurations; end + + # If configured, these `extras` will be added to the field if they aren't already present, + # but removed by from `arguments` before the field's `resolve` is called. + # (The extras _will_ be present for other extensions, though.) + # + # @param new_extras [Array] If provided, assign extras used by this extension + # @return [Array] any extras assigned to this extension + # + # pkg:gem/graphql#lib/graphql/schema/field_extension.rb:59 + def extras(new_extras = T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/find_inherited_value.rb:4 +module GraphQL::Schema::FindInheritedValue + include ::GraphQL::EmptyObjects + + private + + # pkg:gem/graphql#lib/graphql/schema/find_inherited_value.rb:15 + def find_inherited_value(method_name, default_value = T.unsafe(nil)); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/find_inherited_value.rb:5 + def extended(child_cls); end + + # pkg:gem/graphql#lib/graphql/schema/find_inherited_value.rb:9 + def included(child_cls); end + end +end + +# Find schema members using string paths +# +# @example Finding object types +# MySchema.find("SomeObjectType") +# +# @example Finding fields +# MySchema.find("SomeObjectType.myField") +# +# @example Finding arguments +# MySchema.find("SomeObjectType.myField.anArgument") +# +# @example Finding directives +# MySchema.find("@include") +# +# pkg:gem/graphql#lib/graphql/schema/finder.rb:19 +class GraphQL::Schema::Finder + # pkg:gem/graphql#lib/graphql/schema/finder.rb:22 + def initialize(schema); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:26 + def find(path); end + + private + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:57 + def find_in_directive(directive, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:137 + def find_in_enum_type(enum_type, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:103 + def find_in_field(field, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:90 + def find_in_fields_type(type, kind:, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:120 + def find_in_input_object(input_object, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:68 + def find_in_type(type, path:); end + + # pkg:gem/graphql#lib/graphql/schema/finder.rb:55 + def schema; end +end + +# pkg:gem/graphql#lib/graphql/schema/finder.rb:20 +class GraphQL::Schema::Finder::MemberNotFoundError < ::ArgumentError; end + +# pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:5 +module GraphQL::Schema::HasSingleInputArgument + mixes_in_class_methods ::GraphQL::Schema::HasSingleInputArgument::ClassMethods + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:19 + def call; end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:6 + def resolve_with_support(**inputs); end + + private + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:163 + def authorize_arguments(args, values); end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:26 + def flatten_arguments(inputs); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:15 + def included(base); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:57 +module GraphQL::Schema::HasSingleInputArgument::ClassMethods + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:85 + def all_field_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:81 + def any_field_arguments?; end + + # Also apply this argument to the input type: + # + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:90 + def argument(*args, own_argument: T.unsafe(nil), **kwargs, &block); end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:58 + def dummy; end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:69 + def field_arguments(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:73 + def get_field_argument(name, context = T.unsafe(nil)); end + + # The base class for generated input object types + # @param new_class [Class] The base class to use for generating input object definitions + # @return [Class] The base class for this mutation's generated input object (default is {GraphQL::Schema::InputObject}) + # + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:116 + def input_object_class(new_class = T.unsafe(nil)); end + + # @param new_input_type [Class, nil] If provided, it configures this mutation to accept `new_input_type` instead of generating an input type + # @return [Class] The generated {Schema::InputObject} class for this mutation's `input` + # + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:125 + def input_type(new_input_type = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:77 + def own_field_arguments; end + + private + + # Generate the input type for the `input:` argument + # To customize how input objects are generated, override this method + # @return [Class] a subclass of {.input_object_class} + # + # pkg:gem/graphql#lib/graphql/schema/has_single_input_argument.rb:137 + def generate_input_type; end +end + +# pkg:gem/graphql#lib/graphql/schema/input_object.rb:4 +class GraphQL::Schema::InputObject < ::GraphQL::Schema::Member + include ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + include ::GraphQL::Dig + extend ::Forwardable + extend ::GraphQL::Schema::Member::HasArguments + extend ::GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured + extend ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + extend ::GraphQL::Schema::Member::ValidatesInput + extend ::GraphQL::Schema::Member::HasValidators + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:29 + def initialize(arguments, ruby_kwargs:, context:, defaults_used:); end + + # Lookup a key on this object, it accepts new-style underscored symbols + # Or old-style camelized identifiers. + # @param key [Symbol, String] + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:88 + def [](key); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def any?(*_arg0, **_arg1, &_arg2); end + + # @return [GraphQL::Execution::Interpereter::Arguments] The underlying arguments instance + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:24 + def arguments; end + + # @return [GraphQL::Query::Context] The context for this query + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:22 + def context; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:56 + def deconstruct_keys(keys = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def empty?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:98 + def key?(key); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def keys(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:66 + def prepare; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:48 + def to_h; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:52 + def to_hash; end + + # A copy of the Ruby-style hash + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:103 + def to_kwargs; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:70 + def unwrap_value(value); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:108 + def validate_for(context); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:27 + def values(*_arg0, **_arg1, &_arg2); end + + private + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:311 + def overwrite_argument(key, value); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:147 + def argument(*args, **kwargs, &block); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:285 + def arguments(context = T.unsafe(nil), require_defined_arguments = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:120 + def authorized?(obj, value, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:116 + def authorizes?(ctx); end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:235 + def coerce_input(value, ctx); end + + # It's funny to think of a _result_ of an input object. + # This is used for rendering the default value in introspection responses. + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:253 + def coerce_result(value, ctx); end + + # @param new_has_no_arguments [Boolean] Call with `true` to make this InputObject type ignore the requirement to have any defined arguments. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:275 + def has_no_arguments(new_has_no_arguments); end + + # @return [Boolean] `true` if `has_no_arguments(true)` was configued + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:281 + def has_no_arguments?; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:164 + def kind; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:134 + def one_of; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:143 + def one_of?; end + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:171 + def validate_non_null_input(input, ctx, max_errors: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:303 + def define_accessor_method(method_name); end + + # Suppress redefinition warning for objectId arguments + # + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:295 + def suppress_redefinition_warning; end + end +end + +# Raised when an InputObject doesn't have any arguments defined and hasn't explicitly opted out of this requirement +# +# pkg:gem/graphql#lib/graphql/schema/input_object.rb:14 +class GraphQL::Schema::InputObject::ArgumentsAreRequiredError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/input_object.rb:15 + def initialize(input_object_type); end +end + +# pkg:gem/graphql#lib/graphql/schema/interface.rb:4 +module GraphQL::Schema::Interface + include ::GraphQL::Schema::Member::GraphQLTypeNames + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Schema::Member::BaseDSLMethods + extend ::GraphQL::Schema::Member::TypeSystemHelpers + extend ::GraphQL::Schema::Member::HasFields + extend ::GraphQL::Schema::Member::HasFields::InterfaceMethods + extend ::GraphQL::Schema::Member::HasPath + extend ::GraphQL::Schema::Member::RelayShortcuts + extend ::GraphQL::Schema::Member::Scoped + extend ::GraphQL::Schema::Member::HasAstNode + extend ::GraphQL::Schema::Member::HasUnresolvedTypeError + extend ::GraphQL::Schema::Member::HasDataloader + extend ::GraphQL::Schema::Member::HasDirectives + extend ::GraphQL::Schema::Member::HasInterfaces + extend ::GraphQL::Schema::Interface::DefinitionMethods + + # pkg:gem/graphql#lib/graphql/schema/interface.rb:146 + def unwrap; end +end + +# pkg:gem/graphql#lib/graphql/schema/interface.rb:6 +module GraphQL::Schema::Interface::DefinitionMethods + include ::GraphQL::Schema::FindInheritedValue + include ::GraphQL::EmptyObjects + include ::GraphQL::Schema::Member::BaseDSLMethods + include ::GraphQL::Schema::Member::TypeSystemHelpers + include ::GraphQL::Schema::Member::HasFields + include ::GraphQL::Schema::Member::HasFields::InterfaceMethods + include ::GraphQL::Schema::Member::HasPath + include ::GraphQL::Schema::Member::RelayShortcuts + include ::GraphQL::Schema::Member::Scoped + include ::GraphQL::Schema::Member::HasAstNode + include ::GraphQL::Schema::Member::HasUnresolvedTypeError + include ::GraphQL::Schema::Member::HasDataloader + include ::GraphQL::Schema::Member::HasDirectives + include ::GraphQL::Schema::Member::HasInterfaces + + # Methods defined in this block will be: + # - Added as class methods to this interface + # - Added as class methods to all child interfaces + # + # pkg:gem/graphql#lib/graphql/schema/interface.rb:23 + def definition_methods(&block); end + + # Here's the tricky part. Make sure behavior keeps making its way down the inheritance chain. + # + # pkg:gem/graphql#lib/graphql/schema/interface.rb:70 + def included(child_class); end + + # pkg:gem/graphql#lib/graphql/schema/interface.rb:139 + def kind; end + + # Register other Interface or Object types as implementers of this Interface. + # + # When those Interfaces or Objects aren't used as the return values of fields, + # they may have to be registered using this method so that GraphQL-Ruby can find them. + # @param types [Class, Module] + # @return [Array] Implementers of this interface, if they're registered + # + # pkg:gem/graphql#lib/graphql/schema/interface.rb:119 + def orphan_types(*types); end + + # Instance methods defined in this block will become class methods on objects that implement this interface. + # Use it to implement `resolve_each:`, `resolve_batch:`, and `resolve_static:` fields. + # @example + # field :thing, String, resolve_static: true + # + # resolver_methods do + # def thing + # Somehow.get.thing + # end + # end + # + # pkg:gem/graphql#lib/graphql/schema/interface.rb:46 + def resolver_methods(&block); end + + # pkg:gem/graphql#lib/graphql/schema/interface.rb:61 + def type_membership_class(membership_class = T.unsafe(nil)); end + + # @see {Schema::Warden} hides interfaces without visible implementations + # + # pkg:gem/graphql#lib/graphql/schema/interface.rb:57 + def visible?(context); end +end + +# pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:4 +class GraphQL::Schema::IntrospectionSystem + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:7 + def initialize(schema); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:59 + def dynamic_field(name:); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:55 + def dynamic_fields; end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:51 + def entry_point(name:); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:47 + def entry_points; end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:5 + def possible_types; end + + # The introspection system is prepared with a bunch of LateBoundTypes. + # Replace those with the objects that they refer to, since LateBoundTypes + # aren't handled at runtime. + # + # @api private + # @return void + # + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:69 + def resolve_late_bindings; end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:5 + def types; end + + private + + # This is probably not 100% robust -- but it has to be good enough to avoid modifying the built-in introspection types + # + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:123 + def dup_type_class(type_class); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:117 + def get_fields_from_class(class_sym:); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:107 + def load_constant(class_name); end + + # pkg:gem/graphql#lib/graphql/schema/introspection_system.rb:90 + def resolve_late_binding(late_bound_type); end +end + +# Error that is raised when [#Schema#from_definition] is passed an invalid schema definition string. +# +# pkg:gem/graphql#lib/graphql/schema.rb:99 +class GraphQL::Schema::InvalidDocumentError < ::GraphQL::Error; end + +# A stand-in for a type which will be resolved in a given schema, by name. +# TODO: support argument types too, make this a public API somehow +# @api Private +# +# pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:7 +class GraphQL::Schema::LateBoundType + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:10 + def initialize(local_name); end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:9 + def graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:32 + def inspect; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:8 + def name; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:36 + def non_null?; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:24 + def to_list_type; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:20 + def to_non_null_type; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:40 + def to_s; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:28 + def to_type_signature; end + + # pkg:gem/graphql#lib/graphql/schema/late_bound_type.rb:16 + def unwrap; end +end + +# Represents a list type in the schema. +# Wraps a {Schema::Member} as a list type. +# @see Schema::Member::TypeSystemHelpers#to_list_type Create a list type from another GraphQL type +# +# pkg:gem/graphql#lib/graphql/schema/list.rb:8 +class GraphQL::Schema::List < ::GraphQL::Schema::Wrapper + include ::GraphQL::Schema::Member::ValidatesInput + + # pkg:gem/graphql#lib/graphql/schema/list.rb:25 + def authorizes?(ctx); end + + # pkg:gem/graphql#lib/graphql/schema/list.rb:43 + def coerce_input(value, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/list.rb:39 + def coerce_result(value, ctx); end + + # Also for implementing introspection + # + # pkg:gem/graphql#lib/graphql/schema/list.rb:35 + def description; end + + # This is for introspection, where it's expected the name will be `null` + # + # pkg:gem/graphql#lib/graphql/schema/list.rb:30 + def graphql_name; end + + # @return [GraphQL::TypeKinds::LIST] + # + # pkg:gem/graphql#lib/graphql/schema/list.rb:12 + def kind; end + + # @return [true] + # + # pkg:gem/graphql#lib/graphql/schema/list.rb:17 + def list?; end + + # pkg:gem/graphql#lib/graphql/schema/list.rb:21 + def to_type_signature; end + + # pkg:gem/graphql#lib/graphql/schema/list.rb:52 + def validate_non_null_input(value, ctx, max_errors: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/list.rb:83 + def add_max_errors_reached_message(result); end + + # pkg:gem/graphql#lib/graphql/schema/list.rb:74 + def ensure_array(value); end +end + +# You can use the result of {GraphQL::Introspection::INTROSPECTION_QUERY} +# to make a schema. This schema is missing some important details like +# `resolve` functions, but it does include the full type system, +# so you can use it to validate queries. +# +# @see GraphQL::Schema.from_introspection for a public API +# +# pkg:gem/graphql#lib/graphql/schema/loader.rb:10 +module GraphQL::Schema::Loader + extend ::GraphQL::Schema::Loader + + # Create schema with the result of an introspection query. + # @param introspection_result [Hash] A response from {GraphQL::Introspection::INTROSPECTION_QUERY} + # @return [Class] the schema described by `input` + # + # pkg:gem/graphql#lib/graphql/schema/loader.rb:16 + def load(introspection_result); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/loader.rb:197 + def build_arguments(arg_owner, args, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/loader.rb:173 + def build_fields(type_defn, fields, type_resolver); end + + private + + # pkg:gem/graphql#lib/graphql/schema/loader.rb:160 + def define_directive(directive, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/loader.rb:99 + def define_type(type, type_resolver); end + + # pkg:gem/graphql#lib/graphql/schema/loader.rb:78 + def extract_default_value(default_value_str, input_value_ast); end + + # pkg:gem/graphql#lib/graphql/schema/loader.rb:59 + def resolve_type(types, type); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/loader.rb:54 +GraphQL::Schema::Loader::NullScalarCoerce = T.let(T.unsafe(nil), Proc) + +# The base class for things that make up the schema, +# eg objects, enums, scalars. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:7 +class GraphQL::Schema::Member + include ::GraphQL::Schema::Member::GraphQLTypeNames + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Schema::Member::BaseDSLMethods + extend ::GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension + extend ::GraphQL::Schema::Member::TypeSystemHelpers + extend ::GraphQL::Schema::Member::Scoped + extend ::GraphQL::Schema::Member::RelayShortcuts + extend ::GraphQL::Schema::Member::HasPath + extend ::GraphQL::Schema::Member::HasAstNode + extend ::GraphQL::Schema::Member::HasDirectives + + class << self + # pkg:gem/graphql#lib/graphql/schema/member.rb:36 + def authorizes?(_ctx); end + end +end + +# DSL methods shared by lots of things in the GraphQL Schema. +# @api private +# @see Classes that extend this, eg {GraphQL::Schema::Object} +# +# pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:11 +module GraphQL::Schema::Member::BaseDSLMethods + include ::GraphQL::Schema::FindInheritedValue + include ::GraphQL::EmptyObjects + + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:119 + def authorized?(object, context); end + + # Call this method to provide a new comment; OR + # call it without an argument to get the comment + # @param new_comment [String] + # @return [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:47 + def comment(new_comment = T.unsafe(nil)); end + + # Creates the default name for a schema member. + # The default name is the Ruby constant name, + # without any namespaces and with any `-Type` suffix removed + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:107 + def default_graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:123 + def default_relay?; end + + # Call this method to provide a new description; OR + # call it without an argument to get the description + # @param new_description [String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:33 + def description(new_description = T.unsafe(nil)); end + + # Call this with a new name to override the default name for this schema member; OR + # call it without an argument to get the name of this schema member + # + # The default name is implemented in default_graphql_name + # @param new_name [String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:20 + def graphql_name(new_name = T.unsafe(nil)); end + + # @return [Boolean] If true, this object is part of the introspection system + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:76 + def introspection(new_introspection = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:86 + def introspection?; end + + # The mutation this type was derived from, if it was derived from a mutation + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:92 + def mutation(mutation_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:102 + def unwrap; end + + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:115 + def visible?(context); end + + protected + + # Creates the default name for a schema member. + # The default name is the Ruby constant name, + # without any namespaces and with any `-Type` suffix removed + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:129 + def default_graphql_name=(_arg0); end + + # Call this with a new name to override the default name for this schema member; OR + # call it without an argument to get the name of this schema member + # + # The default name is implemented in default_graphql_name + # @param new_name [String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:129 + def graphql_name=(_arg0); end +end + +# This pushes some configurations _down_ the inheritance tree, +# in order to prevent repetitive lookups at runtime. +# +# pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:59 +module GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension + # pkg:gem/graphql#lib/graphql/schema/member/base_dsl_methods.rb:60 + def inherited(child_class); end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:6 +module GraphQL::Schema::Member::BuildType + private + + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:127 + def camelize(string); end + + # Resolves constant from string (based on Rails `ActiveSupport::Inflector.constantize`) + # + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:140 + def constantize(string); end + + # @param type_expr [String, Class, GraphQL::BaseType] + # @return [GraphQL::BaseType] + # + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:12 + def parse_type(type_expr, null:); end + + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:99 + def to_type_name(something); end + + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:171 + def underscore(string); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:127 + def camelize(string); end + + # Resolves constant from string (based on Rails `ActiveSupport::Inflector.constantize`) + # + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:140 + def constantize(string); end + + # @param type_expr [String, Class, GraphQL::BaseType] + # @return [GraphQL::BaseType] + # + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:12 + def parse_type(type_expr, null:); end + + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:99 + def to_type_name(something); end + + # pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:171 + def underscore(string); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/build_type.rb:7 +GraphQL::Schema::Member::BuildType::LIST_TYPE_ERROR = T.let(T.unsafe(nil), String) + +# These constants are interpreted as GraphQL types when defining fields or arguments +# +# @example +# field :is_draft, Boolean, null: false +# field :id, ID, null: false +# field :score, Int, null: false +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/graphql_type_names.rb:14 +module GraphQL::Schema::Member::GraphQLTypeNames; end + +# pkg:gem/graphql#lib/graphql/schema/member/graphql_type_names.rb:15 +GraphQL::Schema::Member::GraphQLTypeNames::Boolean = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/schema/member/graphql_type_names.rb:16 +GraphQL::Schema::Member::GraphQLTypeNames::ID = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/schema/member/graphql_type_names.rb:17 +GraphQL::Schema::Member::GraphQLTypeNames::Int = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:5 +module GraphQL::Schema::Member::HasArguments + include ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + + mixes_in_class_methods ::GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + + # Register this argument with the class. + # @param arg_defn [GraphQL::Schema::Argument] + # @return [GraphQL::Schema::Argument] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:70 + def add_argument(arg_defn); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:223 + def all_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:115 + def any_arguments?; end + + # @param arg_name [Symbol] The underscore-cased name of this argument, `name:` keyword also accepted + # @param type_expr The GraphQL type of this argument; `type:` keyword also accepted + # @param desc [String] Argument description, `description:` keyword also accepted + # @option kwargs [Boolean, :nullable] :required if true, this argument is non-null; if false, this argument is nullable. If `:nullable`, then the argument must be provided, though it may be `null`. + # @option kwargs [String] :description Positional argument also accepted + # @option kwargs [Class, Array] :type Input type; positional argument also accepted + # @option kwargs [Symbol] :name positional argument also accepted + # @option kwargs [Object] :default_value + # @option kwargs [Class, Array] :loads A GraphQL type to load for the given ID when one is present + # @option kwargs [Symbol] :as Override the keyword name when passed to a method + # @option kwargs [Symbol] :prepare A method to call to transform this argument's valuebefore sending it to field resolution + # @option kwargs [Boolean] :camelize if true, the name will be camelized when building the schema + # @option kwargs [Boolean] :from_resolver if true, a Resolver class defined this argument + # @option kwargs [Hash{Class => Hash}] :directives + # @option kwargs [String] :deprecation_reason + # @option kwargs [String] :comment Private, used by GraphQL-Ruby when parsing GraphQL schema files + # @option kwargs [GraphQL::Language::Nodes::InputValueDefinition] :ast_node Private, used by GraphQL-Ruby when parsing schema files + # @option kwargs [Hash, nil] :validates Options for building validators, if any should be applied + # @option kwargs [Boolean] :replace_null_with_default if `true`, incoming values of `null` will be replaced with the configured `default_value` + # @param definition_block [Proc] Called with the newly-created {Argument} + # @param kwargs [Hash] Keywords for defining an argument. Any keywords not documented here must be handled by your base Argument class. + # @return [GraphQL::Schema::Argument] An instance of {argument_class} created from these arguments + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:39 + def argument(arg_name = T.unsafe(nil), type_expr = T.unsafe(nil), desc = T.unsafe(nil), **kwargs, &definition_block); end + + # @param new_arg_class [Class] A class to use for building argument definitions + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:246 + def argument_class(new_arg_class = T.unsafe(nil)); end + + # @return [Hash GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:102 + def arguments(context = T.unsafe(nil), _require_defined_arguments = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:329 + def arguments_statically_coercible?; end + + # @api private + # If given a block, it will eventually yield the loaded args to the block. + # + # If no block is given, it will immediately dataload (but might return a Lazy). + # + # @param values [Hash] + # @param context [GraphQL::Query::Context] + # @yield [Interpreter::Arguments, Execution::Lazy] + # @return [Interpreter::Arguments, Execution::Lazy] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:259 + def coerce_arguments(parent_object, values, context, &block); end + + # @return [GraphQL::Schema::Argument, nil] Argument defined on this thing, fetched by name. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:234 + def get_argument(argument_name, context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:451 + def own_arguments; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:86 + def remove_argument(arg_defn); end + + # Usually, this is validated statically by RequiredArgumentsArePresent, + # but not for directives. + # TODO apply static validations on schema definitions? + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:316 + def validate_directive_argument(arg_defn, value); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:11 + def extended(cls); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:6 + def included(cls); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:337 +module GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:338 + def argument_class(new_arg_class = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:349 +module GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:374 + def authorize_application_object(argument, id, context, loaded_application_object); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:369 + def load_and_authorize_application_object(argument, id, context); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:361 + def load_application_object(argument, id, context); end + + # Called when an argument's `loads:` configuration fails to fetch an application object. + # By default, this method raises the given error, but you can override it to handle failures differently. + # + # @param err [GraphQL::LoadApplicationObjectFailedError] The error that occurred + # @return [Object, nil] If a value is returned, it will be used instead of the failed load + # @api public + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:445 + def load_application_object_failed(err); end + + # Look up the corresponding object for a provided ID. + # By default, it uses Relay-style {Schema.object_from_id}, + # override this to find objects another way. + # + # @param type [Class, Module] A GraphQL type definition + # @param id [String] A client-provided to look up + # @param context [GraphQL::Query::Context] the current context + # + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:357 + def object_from_id(type, id, context); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:119 +module GraphQL::Schema::Member::HasArguments::ClassConfigured + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:120 + def inherited(child_class); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:125 +module GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:146 + def all_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:142 + def any_arguments?; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:126 + def arguments(context = T.unsafe(nil), require_defined_arguments = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:159 + def get_argument(argument_name, context = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:174 +module GraphQL::Schema::Member::HasArguments::FieldConfigured + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:197 + def all_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:193 + def any_arguments?; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:175 + def arguments(context = T.unsafe(nil), _require_defined_arguments = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:321 +module GraphQL::Schema::Member::HasArguments::HasDirectiveArguments + # pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:322 + def validate_directive_argument(arg_defn, value); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_arguments.rb:450 +GraphQL::Schema::Member::HasArguments::NO_ARGUMENTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/schema/member/has_ast_node.rb:5 +module GraphQL::Schema::Member::HasAstNode + # If this schema was parsed from a `.graphql` file (or other SDL), + # this is the AST node that defined this part of the schema. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_ast_node.rb:18 + def ast_node(new_ast_node = T.unsafe(nil)); end + + # If this schema was parsed from a `.graphql` file (or other SDL), + # this is the AST node that defined this part of the schema. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_ast_node.rb:28 + def ast_node=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_ast_node.rb:11 + def inherited(child_cls); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_ast_node.rb:6 + def extended(child_cls); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:5 +module GraphQL::Schema::Member::HasAuthorization + include ::GraphQL::Schema::Member::HasAuthorization::InstanceConfigured + + # pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:17 + def authorized?(object, context); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:10 + def extended(child_class); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:6 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:27 +module GraphQL::Schema::Member::HasAuthorization::ClassConfigured + # pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:28 + def authorizes?(context); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:21 +module GraphQL::Schema::Member::HasAuthorization::InstanceConfigured + # pkg:gem/graphql#lib/graphql/schema/member/has_authorization.rb:22 + def authorizes?(context); end +end + +# @api public +# Shared methods for working with {Dataloader} inside GraphQL runtime objects. +# +# pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:8 +module GraphQL::Schema::Member::HasDataloader + # A shortcut method for loading a key from a source. + # Identical to `dataloader.with(source_class, *source_args).load(load_key)` + # @param source_class [Class] + # @param source_args [Array] Any extra parameters defined in `source_class`'s `initialize` method + # @param load_key [Object] The key to look up using `def fetch` + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:19 + def dataload(source_class, *source_args, load_key); end + + # A shortcut method for loading many keys from a source. + # Identical to `dataloader.with(source_class, *source_args).load_all(load_keys)` + # + # @example + # field :score, Integer, resolve_batch: true + # + # def self.score(posts) + # dataload_all(PostScoreSource, posts.map(&:id)) + # end + # + # @param source_class [Class] + # @param source_args [Array] Any extra parameters defined in `source_class`'s `initialize` method + # @param load_keys [Array] The keys to look up using `def fetch` + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:36 + def dataload_all(source_class, *source_args, load_keys); end + + # @see dataload_association Like `dataload_assocation` but accepts an Array of records (required param) + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:88 + def dataload_all_associations(records, association_name, scope: T.unsafe(nil)); end + + # @see dataload_record Like `dataload_record`, but accepts an Array of `find_by_values` + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:60 + def dataload_all_records(model, find_by_values, find_by: T.unsafe(nil)); end + + # Look up an associated record using a Rails association (via {Dataloader::ActiveRecordAssociationSource}) + # @param association_name [Symbol] A `belongs_to` or `has_one` association. (If a `has_many` association is named here, it will be selected without pagination.) + # @param record [ActiveRecord::Base] The object that the association belongs to. + # @param scope [ActiveRecord::Relation] A scope to look up the associated record in + # @return [ActiveRecord::Base, nil] The associated record, if there is one + # @example Looking up a belongs_to on the current object + # dataload_association(:parent) # Equivalent to `object.parent`, but dataloaded + # @example Looking up an associated record on some other object + # dataload_association(comment, :post) # Equivalent to `comment.post`, but dataloaded + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:78 + def dataload_association(record = T.unsafe(nil), association_name, scope: T.unsafe(nil)); end + + # Find an object with ActiveRecord via {Dataloader::ActiveRecordSource}. + # @param model [Class] + # @param find_by_value [Object] Usually an `id`, might be another value if `find_by:` is also provided + # @param find_by [Symbol, String] A column name to look the record up by. (Defaults to the model's primary key.) + # @return [ActiveRecord::Base, nil] + # @example Finding a record by ID + # dataload_record(Post, 5) # Like `Post.find(5)`, but dataloaded + # @example Finding a record by another attribute + # dataload_record(User, "matz", find_by: :handle) # Like `User.find_by(handle: "matz")`, but dataloaded + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:49 + def dataload_record(model, find_by_value, find_by: T.unsafe(nil)); end + + # @return [GraphQL::Dataloader] The dataloader for the currently-running query + # + # pkg:gem/graphql#lib/graphql/schema/member/has_dataloader.rb:10 + def dataloader; end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:6 +module GraphQL::Schema::Member::HasDeprecationReason + # @return [String, nil] Explains why this member was deprecated (if present, this will be marked deprecated in introspection) + # + # pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:8 + def deprecation_reason; end + + # Set the deprecation reason for this member, or remove it by assigning `nil` + # @param text [String, nil] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:12 + def deprecation_reason=(text); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:22 + def extended(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:27 +module GraphQL::Schema::Member::HasDeprecationReason::ClassMethods + # pkg:gem/graphql#lib/graphql/schema/member/has_deprecation_reason.rb:28 + def deprecation_reason(new_reason = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:6 +module GraphQL::Schema::Member::HasDirectives + # Create an instance of `dir_class` for `self`, using `options`. + # + # It removes a previously-attached instance of `dir_class`, if there is one. + # + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:22 + def directive(dir_class, **options); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:36 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:12 + def inherited(child_cls); end + + # Remove an attached instance of `dir_class`, if there is one + # @param dir_class [Class] + # @return [viod] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:31 + def remove_directive(dir_class); end + + protected + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:114 + def own_directives; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:114 + def own_directives=(_arg0); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:41 + def add_directive(schema_member, directives, directive_class, directive_options); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:7 + def extended(child_cls); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:50 + def get_directives(schema_member, directives, directives_method); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:46 + def remove_directive(directives, directive_class); end + + private + + # Modify `target` by adding items from `dirs` such that: + # - Any name conflict is overridden by the incoming member of `dirs` + # - Any other member of `dirs` is appended + # @param target [Array] + # @param dirs [Array] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_directives.rb:99 + def merge_directives(target, dirs); end + end +end + +# Shared code for Objects, Interfaces, Mutations, Subscriptions +# +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:7 +module GraphQL::Schema::Member::HasFields + include ::GraphQL::EmptyObjects + include ::GraphQL::Schema::Member::HasFields::InterfaceMethods + + # Register this field with the class, overriding a previous one if needed. + # @param field_defn [GraphQL::Schema::Field] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:113 + def add_field(field_defn, method_conflict_warning: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:180 + def all_field_definitions; end + + # Add a field to this object or interface with the given definition + # @param name_positional [Symbol] The underscore-cased version of this field name (will be camelized for the GraphQL API); `name:` keyword is also accepted + # @param type_positional [Class, GraphQL::BaseType, Array] The return type of this field; `type:` keyword is also accepted + # @param desc_positional [String] Field description; `description:` keyword is also accepted + # @option kwargs [Symbol] :name The underscore-cased version of this field name (will be camelized for the GraphQL API); positional argument also accepted + # @option kwargs [Class, GraphQL::BaseType, Array] :type The return type of this field; positional argument is also accepted + # @option kwargs [Boolean] :null (defaults to `true`) `true` if this field may return `null`, `false` if it is never `null` + # @option kwargs [String] :description Field description; positional argument also accepted + # @option kwargs [String] :comment Field comment + # @option kwargs [String] :deprecation_reason If present, the field is marked "deprecated" with this message + # @option kwargs [Symbol] :method The method to call on the underlying object to resolve this field (defaults to `name`) + # @option kwargs [String, Symbol] :hash_key The hash key to lookup on the underlying object (if its a Hash) to resolve this field (defaults to `name` or `name.to_s`) + # @option kwargs [Array] :dig The nested hash keys to lookup on the underlying hash to resolve this field using dig + # @option kwargs [Symbol, true] :resolver_method The method on the type to call to resolve this field (defaults to `name`) + # @option kwargs [Symbol, true] :resolve_static Used by {Schema.execute_next} to produce a single value, shared by all objects which resolve this field. Called on the owner type class with `context, **arguments` + # @option kwargs [Symbol, true] :resolve_batch Used by {Schema.execute_next} map `objects` to a same-sized Array of results. Called on the owner type class with `objects, context, **arguments`. + # @option kwargs [Symbol, true] :resolve_each Used by {Schema.execute_next} to get a value value for each item. Called on the owner type class with `object, context, **arguments`. + # @option kwargs [Symbol, true] :resolve_legacy_instance_method Used by {Schema.execute_next} to get a value value for each item. Calls an instance method on the object type class. + # @option kwargs [Boolean] :connection `true` if this field should get automagic connection behavior; default is to infer by `*Connection` in the return type name + # @option kwargs [Class] :connection_extension The extension to add, to implement connections. If `nil`, no extension is added. + # @option kwargs [Integer, nil] :max_page_size For connections, the maximum number of items to return from this field, or `nil` to allow unlimited results. + # @option kwargs [Integer, nil] :default_page_size For connections, the default number of items to return from this field, or `nil` to return unlimited results. + # @option kwargs [Boolean] :introspection If true, this field will be marked as `#introspection?` and the name may begin with `__` + # @option kwargs [{String=>GraphQL::Schema::Argument, Hash}] :arguments Arguments for this field (may be added in the block, also) + # @option kwargs [Boolean] :camelize If true, the field name will be camelized when building the schema + # @option kwargs [Numeric] :complexity When provided, set the complexity for this field + # @option kwargs [Boolean] :scope If true, the return type's `.scope_items` method will be called on the return value + # @option kwargs [Symbol, String] :subscription_scope A key in `context` which will be used to scope subscription payloads + # @option kwargs [Array Object>>] :extensions Named extensions to apply to this field (see also {#extension}) + # @option kwargs [Hash{Class => Hash}] :directives Directives to apply to this field + # @option kwargs [Boolean] :trace If true, a {GraphQL::Tracing} tracer will measure this scalar field + # @option kwargs [Boolean] :broadcastable Whether or not this field can be distributed in subscription broadcasts + # @option kwargs [Language::Nodes::FieldDefinition, nil] :ast_node If this schema was parsed from definition, this AST node defined the field + # @option kwargs [Boolean] :method_conflict_warning If false, skip the warning if this field's method conflicts with a built-in method + # @option kwargs [Array] :validates Configurations for validating this field + # @option kwargs [Object] :fallback_value A fallback value if the method is not defined + # @option kwargs [Class] :mutation + # @option kwargs [Class] :resolver + # @option kwargs [Class] :subscription + # @option kwargs [Boolean] :dynamic_introspection (Private, used by GraphQL-Ruby) + # @option kwargs [Boolean] :relay_node_field (Private, used by GraphQL-Ruby) + # @option kwargs [Boolean] :relay_nodes_field (Private, used by GraphQL-Ruby) + # @option kwargs [Class, Hash] :dataload Shorthand for dataloader lookups + # @option kwargs [Array<:ast_node, :parent, :lookahead, :owner, :execution_errors, :graphql_name, :argument_details, Symbol>] :extras Extra arguments to be injected into the resolver for this field + # @param kwargs [Hash] Keywords for defining the field. Any not documented here will be passed to your base field class where they must be handled. + # @param definition_block [Proc] an additional block for configuring the field. Receive the field as a block param, or, if no block params are defined, then the block is `instance_eval`'d on the new {Field}. + # @yieldparam field [GraphQL::Schema::Field] The newly-created field instance + # @yieldreturn [void] + # @return [GraphQL::Schema::Field] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:58 + def field(name_positional = T.unsafe(nil), type_positional = T.unsafe(nil), desc_positional = T.unsafe(nil), **kwargs, &definition_block); end + + # @return [Class] The class to initialize when adding fields to this kind of schema member + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:141 + def field_class(new_field_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:151 + def global_id_field(field_name, **kwargs); end + + # @param new_has_no_fields [Boolean] Call with `true` to make this Object type ignore the requirement to have any defined fields. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:165 + def has_no_fields(new_has_no_fields); end + + # @return [Boolean] `true` if `has_no_fields(true)` was configued + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:171 + def has_no_fields?; end + + # @return [Hash GraphQL::Schema::Field, Array>] Fields defined on this class _specifically_, not parent classes + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:176 + def own_fields; end + + private + + # @param field_defn [GraphQL::Schema::Field] + # @return [String] A warning to give when this field definition might conflict with a built-in method + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:318 + def conflict_field_name_warning(field_defn); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:284 + def inherited(subclass); end + + # If `type` is an interface, and `self` has a type membership for `type`, then make sure it's visible. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:294 + def visible_interface_implementation?(type, context, warden); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:277 + def extended(child_class); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:271 + def included(child_class); end + end +end + +# A list of field names that we should advise users to pick a different +# resolve method name. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:108 +GraphQL::Schema::Member::HasFields::CONFLICT_FIELD_NAMES = T.let(T.unsafe(nil), Set) + +# A list of GraphQL-Ruby keywords. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:102 +GraphQL::Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:192 +module GraphQL::Schema::Member::HasFields::InterfaceMethods + # @return [Hash GraphQL::Schema::Field>] Fields on this object, keyed by name, including inherited fields + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:207 + def fields(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:193 + def get_field(field_name, context = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:226 +module GraphQL::Schema::Member::HasFields::ObjectMethods + # @return [Hash GraphQL::Schema::Field>] Fields on this object, keyed by name, including inherited fields + # + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:246 + def fields(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:227 + def get_field(field_name, context = T.unsafe(nil)); end +end + +# A list of Ruby keywords. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/member/has_fields.rb:97 +GraphQL::Schema::Member::HasFields::RUBY_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:6 +module GraphQL::Schema::Member::HasInterfaces + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:7 + def implements(*new_interfaces, **options); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:57 + def interface_type_memberships; end + + # param context [Query::Context] If omitted, skip filtering. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:102 + def interfaces(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:53 + def own_interface_type_memberships; end + + private + + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:134 + def inherited(subclass); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:130 + def extended(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:61 +module GraphQL::Schema::Member::HasInterfaces::ClassConfigured + # This combination of extended -> inherited -> extended + # means that the base class (`Schema::Object`) *won't* + # have the superclass-related code in `InheritedInterfaces`, + # but child classes of `Schema::Object` will have it. + # That way, we don't need a `superclass.respond_to?(...)` check. + # + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:67 + def inherited(child_class); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:72 +module GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:89 + def interface_type_memberships; end + + # pkg:gem/graphql#lib/graphql/schema/member/has_interfaces.rb:73 + def interfaces(context = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_path.rb:6 +module GraphQL::Schema::Member::HasPath + # @return [String] A description of this member's place in the GraphQL schema + # + # pkg:gem/graphql#lib/graphql/schema/member/has_path.rb:8 + def path; end +end + +# Set up a type-specific error to make debugging & bug tracker integration better +# +# pkg:gem/graphql#lib/graphql/schema/member/has_unresolved_type_error.rb:7 +module GraphQL::Schema::Member::HasUnresolvedTypeError + private + + # pkg:gem/graphql#lib/graphql/schema/member/has_unresolved_type_error.rb:9 + def add_unresolved_type_error(child_class); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:5 +module GraphQL::Schema::Member::HasValidators + include ::GraphQL::EmptyObjects + + # Build {GraphQL::Schema::Validator}s based on the given configuration + # and use them for this schema member + # @param validation_config [Hash{Symbol => Hash}] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:12 + def validates(validation_config); end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:20 + def validators; end + + class << self + # pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:50 + def extended(child_cls); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:24 +module GraphQL::Schema::Member::HasValidators::ClassConfigured + # pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:25 + def inherited(child_cls); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:30 +module GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + include ::GraphQL::EmptyObjects + + # pkg:gem/graphql#lib/graphql/schema/member/has_validators.rb:33 + def validators; end +end + +# pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:6 +module GraphQL::Schema::Member::RelayShortcuts + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:53 + def connection_type; end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:24 + def connection_type_class(new_connection_type_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:41 + def edge_type; end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:7 + def edge_type_class(new_edge_type_class = T.unsafe(nil)); end + + protected + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:67 + def configured_connection_type_class; end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:71 + def configured_edge_type_class; end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:75 + def connection_type=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:75 + def connection_type_class=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:75 + def edge_type=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:75 + def edge_type_class=(_arg0); end + + private + + # If one of these values is accessed, initialize all the instance variables to retain + # a consistent object shape. + # + # pkg:gem/graphql#lib/graphql/schema/member/relay_shortcuts.rb:81 + def initialize_relay_metadata; end +end + +# pkg:gem/graphql#lib/graphql/schema/member/scoped.rb:6 +module GraphQL::Schema::Member::Scoped + # pkg:gem/graphql#lib/graphql/schema/member/scoped.rb:31 + def inherited(subclass); end + + # pkg:gem/graphql#lib/graphql/schema/member/scoped.rb:19 + def reauthorize_scoped_objects(new_value = T.unsafe(nil)); end + + # This is called when a field has `scope: true`. + # The field's return type class receives this call. + # + # By default, it's a no-op. Override it to scope your objects. + # + # @param items [Object] Some list-like object (eg, Array, ActiveRecord::Relation) + # @param context [GraphQL::Query::Context] + # @return [Object] Another list-like object, scoped to the current context + # + # pkg:gem/graphql#lib/graphql/schema/member/scoped.rb:15 + def scope_items(items, context); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:6 +module GraphQL::Schema::Member::TypeSystemHelpers + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:7 + def initialize(*_arg0, **_arg1, &_arg2); end + + # @return [GraphQL::TypeKinds::TypeKind] + # + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:52 + def kind; end + + # @return [Boolean] true if this is a list type. A non-nullable list is considered a list. + # + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:43 + def list?; end + + # @return [Boolean] true if this is a non-nullable type. A nullable list of non-nullables is considered nullable. + # + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:38 + def non_null?; end + + # @return [Schema::List] Make a list-type representation of this type + # + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:26 + def to_list_type; end + + # @return [Schema::NonNull] Make a non-null-type representation of this type + # + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:14 + def to_non_null_type; end + + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:47 + def to_type_signature; end + + private + + # pkg:gem/graphql#lib/graphql/schema/member/type_system_helpers.rb:58 + def inherited(subclass); end +end + +# pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:6 +module GraphQL::Schema::Member::ValidatesInput + # pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:23 + def coerce_isolated_input(v); end + + # pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:27 + def coerce_isolated_result(v); end + + # pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:7 + def valid_input?(val, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:19 + def valid_isolated_input?(v); end + + # pkg:gem/graphql#lib/graphql/schema/member/validates_input.rb:11 + def validate_input(val, ctx, max_errors: T.unsafe(nil)); end +end + +# This base class accepts configuration for a mutation root field, +# then it can be hooked up to your mutation root object type. +# +# If you want to customize how this class generates types, in your base class, +# override the various `generate_*` methods. +# +# @see {GraphQL::Schema::RelayClassicMutation} for an extension of this class with some conventions built-in. +# +# @example Creating a comment +# # Define the mutation: +# class Mutations::CreateComment < GraphQL::Schema::Mutation +# argument :body, String, required: true +# argument :post_id, ID, required: true +# +# field :comment, Types::Comment, null: true +# field :errors, [String], null: false +# +# def resolve(body:, post_id:) +# post = Post.find(post_id) +# comment = post.comments.build(body: body, author: context[:current_user]) +# if comment.save +# # Successful creation, return the created object with no errors +# { +# comment: comment, +# errors: [], +# } +# else +# # Failed save, return the errors to the client +# { +# comment: nil, +# errors: comment.errors.full_messages +# } +# end +# end +# end +# +# # Hook it up to your mutation: +# class Types::Mutation < GraphQL::Schema::Object +# field :create_comment, mutation: Mutations::CreateComment +# end +# +# # Call it from GraphQL: +# result = MySchema.execute <<-GRAPHQL +# mutation { +# createComment(postId: "1", body: "Nice Post!") { +# errors +# comment { +# body +# author { +# login +# } +# } +# } +# } +# GRAPHQL +# +# pkg:gem/graphql#lib/graphql/schema/mutation.rb:61 +class GraphQL::Schema::Mutation < ::GraphQL::Schema::Resolver + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + extend ::GraphQL::Schema::Member::HasFields + extend ::GraphQL::Schema::Member::HasFields::ObjectMethods + extend ::GraphQL::Schema::Resolver::HasPayloadType + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/mutation.rb:66 + def call_resolve(_args_hash); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/mutation.rb:73 + def visible?(context); end + + private + + # pkg:gem/graphql#lib/graphql/schema/mutation.rb:79 + def conflict_field_name_warning(field_defn); end + + # Override this to attach self as `mutation` + # + # pkg:gem/graphql#lib/graphql/schema/mutation.rb:84 + def generate_payload_type; end + end +end + +# Represents a non null type in the schema. +# Wraps a {Schema::Member} when it is required. +# @see {Schema::Member::TypeSystemHelpers#to_non_null_type} +# +# pkg:gem/graphql#lib/graphql/schema/non_null.rb:8 +class GraphQL::Schema::NonNull < ::GraphQL::Schema::Wrapper + include ::GraphQL::Schema::Member::ValidatesInput + + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:49 + def coerce_input(value, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:57 + def coerce_result(value, ctx); end + + # This is for implementing introspection + # + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:62 + def description; end + + # This is for introspection, where it's expected the name will be `null` + # + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:45 + def graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:30 + def inspect; end + + # @return [GraphQL::TypeKinds::NON_NULL] + # + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:12 + def kind; end + + # @return [Boolean] True if this type wraps a list type + # + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:22 + def list?; end + + # @return [true] + # + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:17 + def non_null?; end + + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:26 + def to_type_signature; end + + # pkg:gem/graphql#lib/graphql/schema/non_null.rb:34 + def validate_input(value, ctx, max_errors: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/object.rb:7 +class GraphQL::Schema::Object < ::GraphQL::Schema::Member + include ::GraphQL::Schema::Member::HasDataloader + extend ::GraphQL::Schema::Member::HasAuthorization + extend ::GraphQL::Schema::Member::HasAuthorization::ClassConfigured + extend ::GraphQL::Schema::Member::HasFields + extend ::GraphQL::Schema::Member::HasFields::ObjectMethods + extend ::GraphQL::Schema::Member::HasInterfaces + extend ::GraphQL::Schema::Member::HasInterfaces::ClassConfigured + + # pkg:gem/graphql#lib/graphql/schema/object.rb:122 + def initialize(object, context); end + + # @return [GraphQL::Query::Context] the context instance for this query + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:25 + def context; end + + # @return [GraphQL::Dataloader] + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:28 + def dataloader; end + + # @return [Object] the application object this type is wrapping + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:22 + def object; end + + # Call this in a field method to return a value that should be returned to the client + # without any further handling by GraphQL. + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:34 + def raw_value(obj); end + + class << self + # Make a new instance of this type _if_ the auth check passes, + # otherwise, raise an error. + # + # Probably only the framework should call this method. + # + # This might return a {GraphQL::Execution::Lazy} if the user-provided `.authorized?` + # hook returns some lazy value (like a Promise). + # + # The reason that the auth check is in this wrapper method instead of {.new} is because + # of how it might return a Promise. It would be weird if `.new` returned a promise; + # It would be a headache to try to maintain Promise-y state inside a {Schema::Object} + # instance. So, hopefully this wrapper method will do the job. + # + # @param object [Object] The thing wrapped by this object + # @param context [GraphQL::Query::Context] + # @return [GraphQL::Schema::Object, GraphQL::Execution::Lazy] + # @raise [GraphQL::UnauthorizedError] if the user-provided hook returns `false` + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:69 + def authorized_new(object, context); end + + # Set up a type-specific invalid null error to use when this object's non-null fields wrongly return `nil`. + # It should help with debugging and bug tracker integrations. + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:130 + def const_missing(name); end + + # pkg:gem/graphql#lib/graphql/schema/object.rb:140 + def kind; end + + # pkg:gem/graphql#lib/graphql/schema/object.rb:117 + def scoped_new(object, context); end + + # This is called by the runtime to return an object to call methods on. + # + # pkg:gem/graphql#lib/graphql/schema/object.rb:48 + def wrap(object, context); end + + # pkg:gem/graphql#lib/graphql/schema/object.rb:43 + def wrap_scoped(object, context); end + + protected + + # pkg:gem/graphql#lib/graphql/schema/object.rb:41 + def new(*_arg0); end + end +end + +# Raised when an Object doesn't have any field defined and hasn't explicitly opted out of this requirement +# +# pkg:gem/graphql#lib/graphql/schema/object.rb:14 +class GraphQL::Schema::Object::FieldsAreRequiredError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/object.rb:15 + def initialize(object_type); end +end + +# Used to convert your {GraphQL::Schema} to a GraphQL schema string +# +# @example print your schema to standard output (via helper) +# puts GraphQL::Schema::Printer.print_schema(MySchema) +# +# @example print your schema to standard output +# puts GraphQL::Schema::Printer.new(MySchema).print_schema +# +# @example print a single type to standard output +# class Types::Query < GraphQL::Schema::Object +# description "The query root of this schema" +# +# field :post, Types::Post, null: true +# end +# +# class Types::Post < GraphQL::Schema::Object +# description "A blog post" +# +# field :id, ID, null: false +# field :title, String, null: false +# field :body, String, null: false +# end +# +# class MySchema < GraphQL::Schema +# query(Types::Query) +# end +# +# printer = GraphQL::Schema::Printer.new(MySchema) +# puts printer.print_type(Types::Post) +# +# pkg:gem/graphql#lib/graphql/schema/printer.rb:34 +class GraphQL::Schema::Printer < ::GraphQL::Language::Printer + # @param schema [GraphQL::Schema] + # @param context [Hash] + # @param introspection [Boolean] Should include the introspection types in the string? + # + # pkg:gem/graphql#lib/graphql/schema/printer.rb:40 + def initialize(schema, context: T.unsafe(nil), introspection: T.unsafe(nil)); end + + # Return a GraphQL schema string for the defined types in the schema + # + # pkg:gem/graphql#lib/graphql/schema/printer.rb:88 + def print_schema; end + + # pkg:gem/graphql#lib/graphql/schema/printer.rb:92 + def print_type(type); end + + # pkg:gem/graphql#lib/graphql/schema/printer.rb:35 + def schema; end + + # pkg:gem/graphql#lib/graphql/schema/printer.rb:35 + def warden; end + + class << self + # Return the GraphQL schema string for the introspection type system + # + # pkg:gem/graphql#lib/graphql/schema/printer.rb:52 + def print_introspection_schema; end + + # Return a GraphQL schema string for the defined types in the schema + # @param schema [GraphQL::Schema] + # @param context [Hash] + # @param only [<#call(member, ctx)>] + # @param except [<#call(member, ctx)>] + # + # pkg:gem/graphql#lib/graphql/schema/printer.rb:82 + def print_schema(schema, **args); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/printer.rb:97 +class GraphQL::Schema::Printer::IntrospectionPrinter < ::GraphQL::Language::Printer + # pkg:gem/graphql#lib/graphql/schema/printer.rb:98 + def print_schema_definition(schema); end +end + +# pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:4 +module GraphQL::Schema::RactorShareable + class << self + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:5 + def extended(schema_class); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:10 +module GraphQL::Schema::RactorShareable::SchemaExtension + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:12 + def freeze_error_handlers(handlers); end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:20 + def freeze_schema; end +end + +# pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:64 +module GraphQL::Schema::RactorShareable::SchemaExtension::FrozenMethods + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:69 + def directives; end + + # This actually accumulates info during execution... + # How to support it? + # + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:73 + def lazy?(_obj); end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:66 + def multiplex_analyzers; end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:68 + def plugins; end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:67 + def query_analyzers; end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:75 + def resolves_lazies?; end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:74 + def sync_lazy(obj); end + + # pkg:gem/graphql#lib/graphql/schema/ractor_shareable.rb:65 + def tracers; end +end + +# Mutations that extend this base class get some conventions added for free: +# +# - An argument called `clientMutationId` is _always_ added, but it's not passed +# to the resolve method. The value is re-inserted to the response. (It's for +# client libraries to manage optimistic updates.) +# - The returned object type always has a field called `clientMutationId` to support that. +# - The mutation accepts one argument called `input`, `argument`s defined in the mutation +# class are added to that input object, which is generated by the mutation. +# +# These conventions were first specified by Relay Classic, but they come in handy: +# +# - `clientMutationId` supports optimistic updates and cache rollbacks on the client +# - using a single `input:` argument makes it easy to post whole JSON objects to the mutation +# using one GraphQL variable (`$input`) instead of making a separate variable for each argument. +# +# @see {GraphQL::Schema::Mutation} for an example, it's basically the same. +# +# pkg:gem/graphql#lib/graphql/schema/relay_classic_mutation.rb:22 +class GraphQL::Schema::RelayClassicMutation < ::GraphQL::Schema::Mutation + include ::GraphQL::Schema::HasSingleInputArgument + extend ::GraphQL::Schema::HasSingleInputArgument::ClassMethods + + # pkg:gem/graphql#lib/graphql/schema/relay_classic_mutation.rb:54 + def call; end + + # Override {GraphQL::Schema::Resolver#resolve_with_support} to + # delete `client_mutation_id` from the kwargs. + # + # pkg:gem/graphql#lib/graphql/schema/relay_classic_mutation.rb:34 + def resolve_with_support(**inputs); end +end + +# A class-based container for field configuration and resolution logic. It supports: +# +# - Arguments, via `.argument(...)` helper, which will be applied to the field. +# - Return type, via `.type(..., null: ...)`, which will be applied to the field. +# - Description, via `.description(...)`, which will be applied to the field +# - Comment, via `.comment(...)`, which will be applied to the field +# - Resolution, via `#resolve(**args)` method, which will be called to resolve the field. +# - `#object` and `#context` accessors for use during `#resolve`. +# +# Resolvers can be attached with the `resolver:` option in a `field(...)` call. +# +# A resolver's configuration may be overridden with other keywords in the `field(...)` call. +# +# @see {GraphQL::Schema::Mutation} for a concrete subclass of `Resolver`. +# @see {GraphQL::Function} `Resolver` is a replacement for `GraphQL::Function` +# +# pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:5 +class GraphQL::Schema::Resolver + include ::GraphQL::Schema::Member::GraphQLTypeNames + include ::GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + include ::GraphQL::Schema::Member::HasPath + include ::GraphQL::Schema::Member::HasDataloader + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Schema::Member::BaseDSLMethods + extend ::GraphQL::Schema::Member::HasArguments + extend ::GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured + extend ::GraphQL::Schema::Member::HasAuthorization + extend ::GraphQL::Schema::Member::HasAuthorization::ClassConfigured + extend ::GraphQL::Schema::Member::HasValidators + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured + extend ::GraphQL::Schema::Member::HasPath + extend ::GraphQL::Schema::Member::HasDirectives + extend ::GraphQL::Schema::Member::HasDeprecationReason + extend ::GraphQL::Schema::Member::HasDeprecationReason::ClassMethods + + # @param object [Object] The application object that this field is being resolved on + # @param context [GraphQL::Query::Context] + # @param field [GraphQL::Schema::Field] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:37 + def initialize(object:, context:, field:); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:128 + def arguments; end + + # Called after arguments are loaded, but before resolving. + # + # Override it to check everything before calling the mutation. + # @param inputs [Hash] The input arguments + # @raise [GraphQL::ExecutionError] To add an error to the response + # @raise [GraphQL::UnauthorizedError] To signal an authorization failure + # @return [Boolean, early_return_data] If `false`, execution will stop (and `early_return_data` will be returned instead, if present.) + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:222 + def authorized?(**inputs); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:62 + def call; end + + # @api private {GraphQL::Schema::Mutation} uses this to clear the dataloader cache + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:187 + def call_resolve(args_hash); end + + # @return [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:55 + def context; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def exec_index; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def exec_index=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def exec_result; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def exec_result=(_arg0); end + + # @return [GraphQL::Schema::Field] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:58 + def field; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def field_resolve_step; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def field_resolve_step=(_arg0); end + + # @return [Object] The application object this field is being resolved on + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:52 + def object; end + + # @return [Object] The application object this field is being resolved on + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:52 + def object=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:60 + def prepared_arguments=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def raw_arguments; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:49 + def raw_arguments=(_arg0); end + + # Called before arguments are prepared. + # Implement this hook to make checks before doing any work. + # + # If it returns a lazy object (like a promise), it will be synced by GraphQL + # (but the resulting value won't be used). + # + # @param args [Hash] The input arguments, if there are any + # @raise [GraphQL::ExecutionError] To add an error to the response + # @raise [GraphQL::UnauthorizedError] To signal an authorization failure + # @return [Boolean, early_return_data] If `false`, execution will stop (and `early_return_data` will be returned instead, if present.) + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:211 + def ready?(**args); end + + # Do the work. Everything happens here. + # @return [Object] An object corresponding to the return type + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:197 + def resolve(**args); end + + # This method is _actually_ called by the runtime, + # it does some preparation and then eventually calls + # the user-defined `#resolve` method. + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:136 + def resolve_with_support(**args); end + + # Called when an object loaded by `loads:` fails the `.authorized?` check for its resolved GraphQL object type. + # + # By default, the error is re-raised and passed along to {{Schema.unauthorized_object}}. + # + # Any value returned here will be used _instead of_ of the loaded object. + # @param err [GraphQL::UnauthorizedError] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:238 + def unauthorized_object(err); end + + private + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:244 + def authorize_arguments(args, inputs); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:290 + def get_argument(name, context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:263 + def load_arguments(args); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:307 + def all_field_argument_definitions; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:299 + def any_field_arguments?; end + + # Add an argument to this field's signature, but + # also add some preparation hook methods which will be used for this argument + # @see {GraphQL::Schema::Argument#initialize} for the signature + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:448 + def argument(*args, **kwargs, &block); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:228 + def authorizes?(context); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:385 + def broadcastable(new_broadcastable); end + + # @return [Boolean, nil] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:390 + def broadcastable?; end + + # Specifies the complexity of the field. Defaults to `1` + # @return [Integer, Proc] + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:378 + def complexity(new_complexity = T.unsafe(nil)); end + + # Get or set the `default_page_size:` which will be configured for fields using this resolver + # (`nil` means "unlimited default page size".) + # @param default_page_size [Integer, nil] Set a new value + # @return [Integer, nil] The `default_page_size` assigned to fields that use this resolver + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:423 + def default_page_size(new_default_page_size = T.unsafe(nil)); end + + # Registers new extension + # @param extension [Class] Extension class + # @param options [Hash] Optional extension options + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:457 + def extension(extension, **options); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:463 + def extensions; end + + # Additional info injected into {#resolve} + # @see {GraphQL::Schema::Field#extras} + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:322 + def extras(new_extras = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:295 + def field_arguments(context = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:303 + def get_field_argument(name, context = T.unsafe(nil)); end + + # @return [Boolean] `true` if this resolver or a superclass has an assigned `default_page_size` + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:436 + def has_default_page_size?; end + + # @return [Boolean] `true` if this resolver or a superclass has an assigned `max_page_size` + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:415 + def has_max_page_size?; end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:482 + def inherited(child_class); end + + # Get or set the `max_page_size:` which will be configured for fields using this resolver + # (`nil` means "unlimited max page size".) + # @param max_page_size [Integer, nil] Set a new value + # @return [Integer, nil] The `max_page_size` assigned to fields that use this resolver + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:402 + def max_page_size(new_max_page_size = T.unsafe(nil)); end + + # If `true` (default), then the return type for this resolver will be nullable. + # If `false`, then the return type is non-null. + # + # @see #type which sets the return type of this field and accepts a `null:` option + # @param allow_null [Boolean] Whether or not the response can be null + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:335 + def null(allow_null = T.unsafe(nil)); end + + # Default `:resolve` set below. + # @return [Symbol] The method to call on instances of this object to resolve the field + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:313 + def resolve_method(new_method = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:343 + def resolver_method(new_method_name = T.unsafe(nil)); end + + # Call this method to get the return type of the field, + # or use it as a configuration method to assign a return type + # instead of generating one. + # TODO unify with {#null} + # @param new_type [Class, Array, nil] If a type definition class is provided, it will be used as the return type of the field + # @param null [true, false] Whether or not the field may return `nil` + # @return [Class] The type which this field returns. + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:358 + def type(new_type = T.unsafe(nil), null: T.unsafe(nil)); end + + # A non-normalized type configuration, without `null` applied + # + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:441 + def type_expr; end + + private + + # pkg:gem/graphql#lib/graphql/schema/resolver.rb:489 + def own_extensions; end + end +end + +# Adds `field(...)` helper to resolvers so that they can +# generate payload types. +# +# Or, an already-defined one can be attached with `payload_type(...)`. +# +# pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:10 +module GraphQL::Schema::Resolver::HasPayloadType + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:62 + def field(*args, **kwargs, &block); end + + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:36 + def field_class(new_class = T.unsafe(nil)); end + + # An object class to use for deriving return types + # @param new_class [Class, nil] Defaults to {GraphQL::Schema::Object} + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:49 + def object_class(new_class = T.unsafe(nil)); end + + # Call this method to get the derived return type of the mutation, + # or use it as a configuration method to assign a return type + # instead of generating one. + # @param new_payload_type [Class, nil] If a type definition class is provided, it will be used as the return type of the mutation field + # @return [Class] The object type which this mutation returns. + # + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:16 + def payload_type(new_payload_type = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:23 + def type(new_type = T.unsafe(nil), null: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:34 + def type_expr(new_payload_type = T.unsafe(nil)); end + + private + + # Build a subclass of {.object_class} based on `self`. + # This value will be cached as `{.payload_type}`. + # Override this hook to customize return type generation. + # + # pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:89 + def generate_payload_type; end +end + +# pkg:gem/graphql#lib/graphql/schema/resolver/has_payload_type.rb:60 +GraphQL::Schema::Resolver::HasPayloadType::NO_INTERFACES = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/scalar.rb:4 +class GraphQL::Schema::Scalar < ::GraphQL::Schema::Member + extend ::GraphQL::Schema::Member::ValidatesInput + + class << self + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:8 + def coerce_input(val, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:12 + def coerce_result(val, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:32 + def default_scalar(is_default = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:39 + def default_scalar?; end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:16 + def kind; end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:20 + def specified_by_url(new_url = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/scalar.rb:43 + def validate_non_null_input(value, ctx, max_errors: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema.rb:2072 +module GraphQL::Schema::SubclassGetReferencesTo + # pkg:gem/graphql#lib/graphql/schema.rb:2073 + def get_references_to(type_defn); end +end + +# This class can be extended to create fields on your subscription root. +# +# It provides hooks for the different parts of the subscription lifecycle: +# +# - `#authorized?`: called before initial subscription and subsequent updates +# - `#subscribe`: called for the initial subscription +# - `#update`: called for subsequent update +# +# Also, `#unsubscribe` terminates the subscription. +# +# pkg:gem/graphql#lib/graphql/schema/subscription.rb:14 +class GraphQL::Schema::Subscription < ::GraphQL::Schema::Resolver + extend ::GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + extend ::GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + extend ::GraphQL::Schema::Resolver::HasPayloadType + extend ::GraphQL::Schema::Member::HasFields + extend ::GraphQL::Schema::Member::HasFields::ObjectMethods + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:21 + def initialize(object:, context:, field:); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:34 + def call_resolve(args_hash); end + + # @return [Subscriptions::Event] This object is used as a representation of this subscription for the backend + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:228 + def event; end + + # If an argument is flagged with `loads:` and no object is found for it, + # remove this subscription (assuming that the object was deleted in the meantime, + # or that it became inaccessible). + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:138 + def load_application_object_failed(err); end + + # Implement the {Resolve} API. + # You can implement this if you want code to run for _both_ the initial subscription + # and for later updates. Or, implement {#subscribe} and {#update} + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:92 + def resolve(**args); end + + # Wrap the user-defined `#subscribe` hook + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:100 + def resolve_subscribe(**args); end + + # Wrap the user-provided `#update` hook + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:118 + def resolve_update(**args); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:64 + def resolve_with_support(**args); end + + # The default implementation returns nothing on subscribe. + # Override it to return an object or + # `:no_response` to (explicitly) return nothing. + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:112 + def subscribe(args = T.unsafe(nil)); end + + # @return [Boolean] `true` if {#write_subscription} was called already + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:223 + def subscription_written?; end + + # Call this to halt execution and remove this subscription from the system + # @param update_value [Object] if present, deliver this update before unsubscribing + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:148 + def unsubscribe(update_value = T.unsafe(nil)); end + + # The default implementation returns the root object. + # Override it to return {NO_UPDATE} if you want to + # skip updates sometimes. Or override it to return a different object. + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:131 + def update(args = T.unsafe(nil)); end + + # Calls through to `schema.subscriptions` to register this subscription with the backend. + # This is automatically called by GraphQL-Ruby after a query finishes successfully, + # but if you need to commit the subscription during `#subscribe`, you can call it there. + # (This method also sets a flag showing that this subscription was already written.) + # + # If you call this method yourself, you may also need to {#unsubscribe} + # or call `subscriptions.delete_subscription` to clean up the database if the query crashes with an error + # later in execution. + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:212 + def write_subscription; end + + class << self + # Call this method to provide a new subscription_scope; OR + # call it without an argument to get the subscription_scope + # @param new_scope [Symbol] + # @param optional [Boolean] If true, then don't require `scope:` to be provided to updates to this subscription. + # @return [Symbol] + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:164 + def subscription_scope(new_scope = T.unsafe(nil), optional: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:175 + def subscription_scope_optional?; end + + # This is called during initial subscription to get a "name" for this subscription. + # Later, when `.trigger` is called, this will be called again to build another "name". + # Any subscribers with matching topic will begin the update flow. + # + # The default implementation creates a string using the field name, subscription scope, and argument keys and values. + # In that implementation, only `.trigger` calls with _exact matches_ result in updates to subscribers. + # + # To implement a filtered stream-type subscription flow, override this method to return a string with field name and subscription scope. + # Then, implement {#update} to compare its arguments to the current `object` and return {NO_UPDATE} when an + # update should be filtered out. + # + # @see {#update} for how to skip updates when an event comes with a matching topic. + # @param arguments [Hash Object>] The arguments for this topic, in GraphQL-style (camelized strings) + # @param field [GraphQL::Schema::Field] + # @param scope [Object, nil] A value corresponding to `.trigger(... scope:)` (for updates) or the `subscription_scope` found in `context` (for initial subscriptions). + # @return [String] An identifier corresponding to a stream of updates + # + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:199 + def topic_for(arguments:, field:, scope:); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/subscription.rb:155 +class GraphQL::Schema::Subscription::EarlyUnsubscribe < ::GraphQL::RuntimeError + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:156 + def unsubscribed_result; end + + # pkg:gem/graphql#lib/graphql/schema/subscription.rb:156 + def unsubscribed_result=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/schema/subscription.rb:17 +GraphQL::Schema::Subscription::NO_UPDATE = T.let(T.unsafe(nil), Symbol) + +# This plugin will stop resolving new fields after `max_seconds` have elapsed. +# After the time has passed, any remaining fields will be `nil`, with errors added +# to the `errors` key. Any already-resolved fields will be in the `data` key, so +# you'll get a partial response. +# +# You can subclass `GraphQL::Schema::Timeout` and override `max_seconds` and/or `handle_timeout` +# to provide custom logic when a timeout error occurs. +# +# Note that this will stop a query _in between_ field resolutions, but +# it doesn't interrupt long-running `resolve` functions. Be sure to use +# timeout options for external connections. For more info, see +# www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/ +# +# @example Stop resolving fields after 2 seconds +# class MySchema < GraphQL::Schema +# use GraphQL::Schema::Timeout, max_seconds: 2 +# end +# +# @example Notifying Bugsnag and logging a timeout +# class MyTimeout < GraphQL::Schema::Timeout +# def handle_timeout(error, query) +# Rails.logger.warn("GraphQL Timeout: #{error.message}: #{query.query_string}") +# Bugsnag.notify(error, {query_string: query.query_string}) +# end +# end +# +# class MySchema < GraphQL::Schema +# use MyTimeout, max_seconds: 2 +# end +# +# pkg:gem/graphql#lib/graphql/schema/timeout.rb:35 +class GraphQL::Schema::Timeout + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:41 + def initialize(max_seconds:); end + + # Call this method (eg, from {#handle_timeout}) to disable timeout tracking + # for the given query. + # @param query [GraphQL::Query] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:117 + def disable_timeout(query); end + + # Invoked when a query times out. + # @param error [GraphQL::Schema::Timeout::TimeoutError] + # @param query [GraphQL::Error] + # + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:109 + def handle_timeout(error, query); end + + # Called at the start of each query. + # The default implementation returns the `max_seconds:` value from installing this plugin. + # + # @param query [GraphQL::Query] The query that's about to run + # @return [Numeric, false] The number of seconds after which to interrupt query execution and call {#handle_error}, or `false` to bypass the timeout. + # + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:102 + def max_seconds(query); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:36 + def use(schema, max_seconds: T.unsafe(nil)); end + end +end + +# This error is raised when a query exceeds `max_seconds`. +# Since it's a child of {GraphQL::ExecutionError}, +# its message will be added to the response's `errors` key. +# +# To raise an error that will stop query resolution, use a custom block +# to take this error and raise a new one which _doesn't_ descend from {GraphQL::ExecutionError}, +# such as `RuntimeError`. +# +# pkg:gem/graphql#lib/graphql/schema/timeout.rb:129 +class GraphQL::Schema::Timeout::TimeoutError < ::GraphQL::ExecutionError + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:130 + def initialize(field); end +end + +# pkg:gem/graphql#lib/graphql/schema/timeout.rb:45 +module GraphQL::Schema::Timeout::Trace + # @param max_seconds [Numeric] how many seconds the query should be allowed to resolve new fields + # + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:47 + def initialize(timeout:, **rest); end + + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:71 + def begin_execute_field(field, _arguments, _objects, query); end + + # pkg:gem/graphql#lib/graphql/schema/timeout.rb:52 + def execute_multiplex(multiplex:); end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/type_expression.rb:5 +module GraphQL::Schema::TypeExpression + class << self + # Fetch a type from a type map by its AST specification. + # Return `nil` if not found. + # @param type_owner [#type] A thing for looking up types by name + # @param ast_node [GraphQL::Language::Nodes::AbstractNode] + # @return [Class, GraphQL::Schema::NonNull, GraphQL::Schema:List] + # + # pkg:gem/graphql#lib/graphql/schema/type_expression.rb:11 + def build_type(type_owner, ast_node); end + + private + + # pkg:gem/graphql#lib/graphql/schema/type_expression.rb:31 + def wrap_type(type, wrapper_method); end + end +end + +# This class joins an object type to an abstract type (interface or union) of which +# it is a member. +# +# pkg:gem/graphql#lib/graphql/schema/type_membership.rb:7 +class GraphQL::Schema::TypeMembership + # Called when an object is hooked up to an abstract type, such as {Schema::Union.possible_types} + # or {Schema::Object.implements} (for interfaces). + # + # @param abstract_type [Class, Module] + # @param object_type [Class] + # @param options [Hash] Any options passed to `.possible_types` or `.implements` + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:23 + def initialize(abstract_type, object_type, **options); end + + # @return [Class, Module] + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:12 + def abstract_type; end + + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:36 + def graphql_name; end + + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:44 + def inspect; end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:9 + def object_type; end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:9 + def object_type=(_arg0); end + + # @return [Hash] + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:15 + def options; end + + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:40 + def path; end + + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:48 + def type_class; end + + # @return [Boolean] if false, {#object_type} will be treated as _not_ a member of {#abstract_type} + # + # pkg:gem/graphql#lib/graphql/schema/type_membership.rb:30 + def visible?(ctx); end +end + +# pkg:gem/graphql#lib/graphql/schema/union.rb:4 +class GraphQL::Schema::Union < ::GraphQL::Schema::Member + extend ::GraphQL::Schema::Member::HasUnresolvedTypeError + + class << self + # pkg:gem/graphql#lib/graphql/schema/union.rb:31 + def all_possible_types; end + + # Update a type membership whose `.object_type` is a string or late-bound type + # so that the type membership's `.object_type` is the given `object_type`. + # (This is used for updating the union after the schema as lazily loaded the union member.) + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/union.rb:55 + def assign_type_membership_object_type(object_type); end + + # pkg:gem/graphql#lib/graphql/schema/union.rb:8 + def inherited(child_class); end + + # pkg:gem/graphql#lib/graphql/schema/union.rb:43 + def kind; end + + # pkg:gem/graphql#lib/graphql/schema/union.rb:13 + def possible_types(*types, context: T.unsafe(nil), **options); end + + # pkg:gem/graphql#lib/graphql/schema/union.rb:35 + def type_membership_class(membership_class = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/union.rb:47 + def type_memberships; end + + private + + # pkg:gem/graphql#lib/graphql/schema/union.rb:72 + def assert_valid_union_member(type_defn); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:6 +module GraphQL::Schema::UniqueWithinType + private + + # @param node_id [String] A unique ID generated by {.encode} + # @return [Array<(String, String)>] The type name & value passed to {.encode} + # + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:29 + def decode(node_id, separator: T.unsafe(nil)); end + + # @param type_name [String] + # @param object_value [Any] + # @return [String] a unique, opaque ID generated as a function of the two inputs + # + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:17 + def encode(type_name, object_value, separator: T.unsafe(nil)); end + + class << self + # @param node_id [String] A unique ID generated by {.encode} + # @return [Array<(String, String)>] The type name & value passed to {.encode} + # + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:29 + def decode(node_id, separator: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:8 + def default_id_separator; end + + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:8 + def default_id_separator=(_arg0); end + + # @param type_name [String] + # @param object_value [Any] + # @return [String] a unique, opaque ID generated as a function of the two inputs + # + # pkg:gem/graphql#lib/graphql/schema/unique_within_type.rb:17 + def encode(type_name, object_value, separator: T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema.rb:90 +class GraphQL::Schema::UnresolvedLateBoundTypeError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema.rb:92 + def initialize(type:); end + + # pkg:gem/graphql#lib/graphql/schema.rb:91 + def type; end +end + +# pkg:gem/graphql#lib/graphql/schema/validator.rb:5 +class GraphQL::Schema::Validator + include ::GraphQL::EmptyObjects + + # @param validated [GraphQL::Schema::Argument, GraphQL::Schema::Field, GraphQL::Schema::Resolver, Class] The argument or argument owner this validator is attached to + # @param allow_blank [Boolean] if `true`, then objects that respond to `.blank?` and return true for `.blank?` will skip this validation + # @param allow_null [Boolean] if `true`, then incoming `null`s will skip this validation + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:13 + def initialize(validated:, allow_blank: T.unsafe(nil), allow_null: T.unsafe(nil)); end + + # This is like `String#%`, but it supports the case that only some of `string`'s + # values are present in `substitutions` + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:29 + def partial_format(string, substitutions); end + + # @return [Boolean] `true` if `value` is `nil` and this validator has `allow_null: true` or if value is `.blank?` and this validator has `allow_blank: true` + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:47 + def permitted_empty_value?(value); end + + # @param object [Object] The application object that this argument's field is being resolved for + # @param context [GraphQL::Query::Context] + # @param value [Object] The client-provided value for this argument (after parsing and coercing by the input type) + # @return [nil, Array, String] Error message or messages to add + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:23 + def validate(object, context, value); end + + # The thing being validated + # @return [GraphQL::Schema::Argument, GraphQL::Schema::Field, GraphQL::Schema::Resolver, Class] + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:8 + def validated; end + + # @return [Object] The current value to use for validation, based on `config_value` from configuration time. If a Proc is given, this calls it and returns it. + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:38 + def validation_parameter(config_value); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/validator.rb:109 + def all_validators; end + + # pkg:gem/graphql#lib/graphql/schema/validator.rb:109 + def all_validators=(_arg0); end + + # @param schema_member [GraphQL::Schema::Field, GraphQL::Schema::Argument, Class] + # @param validates_hash [Hash{Symbol => Hash}, Hash{Class => Hash} nil] A configuration passed as `validates:` + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:55 + def from_config(schema_member, validates_hash); end + + # Add `validator_class` to be initialized when `validates:` is given `name`. + # (It's initialized with whatever options are given by the key `name`). + # @param name [Symbol] + # @param validator_class [Class] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:95 + def install(name, validator_class); end + + # Remove whatever validator class is {.install}ed at `name`, if there is one + # @param name [Symbol] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:103 + def uninstall(name); end + + # @param validators [Array] + # @param object [Object] + # @param context [Query::Context] + # @param value [Object] + # @return [void] + # @raises [ValidationFailedError] + # + # pkg:gem/graphql#lib/graphql/schema/validator.rb:131 + def validate!(validators, object, context, value, as: T.unsafe(nil)); end + end +end + +# Use this to validate each member of an array value. +# +# @example validate format of all strings in an array +# +# argument :handles, [String], +# validates: { all: { format: { with: /\A[a-z0-9_]+\Z/ } } } +# +# @example multiple validators can be combined +# +# argument :handles, [String], +# validates: { all: { format: { with: /\A[a-z0-9_]+\Z/ }, length: { maximum: 32 } } } +# +# @example any type can be used +# +# argument :choices, [Integer], +# validates: { all: { inclusion: { in: 1..12 } } } +# +# pkg:gem/graphql#lib/graphql/schema/validator/all_validator.rb:23 +class GraphQL::Schema::Validator::AllValidator < ::GraphQL::Schema::Validator + # pkg:gem/graphql#lib/graphql/schema/validator/all_validator.rb:24 + def initialize(validated:, allow_blank: T.unsafe(nil), allow_null: T.unsafe(nil), **validators); end + + # pkg:gem/graphql#lib/graphql/schema/validator/all_validator.rb:30 + def validate(object, context, value); end +end + +# Use this to specifically reject values that respond to `.blank?` and respond truthy for that method. +# +# @example Require a non-empty string for an argument +# argument :name, String, required: true, validate: { allow_blank: false } +# +# pkg:gem/graphql#lib/graphql/schema/validator/allow_blank_validator.rb:10 +class GraphQL::Schema::Validator::AllowBlankValidator < ::GraphQL::Schema::Validator + # pkg:gem/graphql#lib/graphql/schema/validator/allow_blank_validator.rb:11 + def initialize(allow_blank_positional = T.unsafe(nil), allow_blank: T.unsafe(nil), message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/allow_blank_validator.rb:17 + def validate(_object, _context, value); end +end + +# Use this to specifically reject or permit `nil` values (given as `null` from GraphQL). +# +# @example require a non-null value for an argument if it is provided +# argument :name, String, required: false, validates: { allow_null: false } +# +# pkg:gem/graphql#lib/graphql/schema/validator/allow_null_validator.rb:10 +class GraphQL::Schema::Validator::AllowNullValidator < ::GraphQL::Schema::Validator + # pkg:gem/graphql#lib/graphql/schema/validator/allow_null_validator.rb:12 + def initialize(allow_null_positional = T.unsafe(nil), allow_null: T.unsafe(nil), message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/allow_null_validator.rb:18 + def validate(_object, _context, value); end +end + +# pkg:gem/graphql#lib/graphql/schema/validator/allow_null_validator.rb:11 +GraphQL::Schema::Validator::AllowNullValidator::MESSAGE = T.let(T.unsafe(nil), String) + +# Use this to specifically reject values from an argument. +# +# @example disallow certain values +# +# argument :favorite_non_prime, Integer, required: true, +# validates: { exclusion: { in: [2, 3, 5, 7, ... ]} } +# +# pkg:gem/graphql#lib/graphql/schema/validator/exclusion_validator.rb:13 +class GraphQL::Schema::Validator::ExclusionValidator < ::GraphQL::Schema::Validator + # @param message [String] + # @param in [Array] The values to reject + # + # pkg:gem/graphql#lib/graphql/schema/validator/exclusion_validator.rb:16 + def initialize(in:, message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/exclusion_validator.rb:23 + def validate(_object, _context, value); end +end + +# Use this to assert that string values match (or don't match) the given RegExp. +# +# @example requiring input to match a pattern +# +# argument :handle, String, required: true, +# validates: { format: { with: /\A[a-z0-9_]+\Z/ } } +# +# @example reject inputs that match a pattern +# +# argument :word_that_doesnt_begin_with_a_vowel, String, required: true, +# validates: { format: { without: /\A[aeiou]/ } } +# +# # It's pretty hard to come up with a legitimate use case for `without:` +# +# pkg:gem/graphql#lib/graphql/schema/validator/format_validator.rb:20 +class GraphQL::Schema::Validator::FormatValidator < ::GraphQL::Schema::Validator + # @param with [RegExp, nil] + # @param without [Regexp, nil] + # @param message [String] + # + # pkg:gem/graphql#lib/graphql/schema/validator/format_validator.rb:24 + def initialize(with: T.unsafe(nil), without: T.unsafe(nil), message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/format_validator.rb:36 + def validate(_object, _context, value); end +end + +# You can use this to allow certain values for an argument. +# +# Usually, a {GraphQL::Schema::Enum} is better for this, because it's self-documenting. +# +# @example only allow certain values for an argument +# +# argument :favorite_prime, Integer, required: true, +# validates: { inclusion: { in: [2, 3, 5, 7, 11, ... ] } } +# +# pkg:gem/graphql#lib/graphql/schema/validator/inclusion_validator.rb:15 +class GraphQL::Schema::Validator::InclusionValidator < ::GraphQL::Schema::Validator + # @param message [String] + # @param in [Array] The values to allow + # + # pkg:gem/graphql#lib/graphql/schema/validator/inclusion_validator.rb:18 + def initialize(in:, message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/inclusion_validator.rb:25 + def validate(_object, _context, value); end +end + +# Use this to enforce a `.length` restriction on incoming values. It works for both Strings and Lists. +# +# @example Allow no more than 10 IDs +# +# argument :ids, [ID], required: true, validates: { length: { maximum: 10 } } +# +# @example Require three selections +# +# argument :ice_cream_preferences, [ICE_CREAM_FLAVOR], required: true, validates: { length: { is: 3 } } +# +# pkg:gem/graphql#lib/graphql/schema/validator/length_validator.rb:16 +class GraphQL::Schema::Validator::LengthValidator < ::GraphQL::Schema::Validator + # @param maximum [Integer] + # @param too_long [String] Used when `maximum` is exceeded or value is greater than `within` + # @param minimum [Integer] + # @param too_short [String] Used with value is less than `minimum` or less than `within` + # @param is [Integer] Exact length requirement + # @param wrong_length [String] Used when value doesn't match `is` + # @param within [Range] An allowed range (becomes `minimum:` and `maximum:` under the hood) + # @param message [String] + # + # pkg:gem/graphql#lib/graphql/schema/validator/length_validator.rb:25 + def initialize(maximum: T.unsafe(nil), too_long: T.unsafe(nil), minimum: T.unsafe(nil), too_short: T.unsafe(nil), is: T.unsafe(nil), within: T.unsafe(nil), wrong_length: T.unsafe(nil), message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/length_validator.rb:45 + def validate(_object, _context, value); end +end + +# Use this to assert numerical comparisons hold true for inputs. +# +# @example Require a number between 0 and 1 +# +# argument :batting_average, Float, required: true, validates: { numericality: { within: 0..1 } } +# +# @example Require the number 42 +# +# argument :the_answer, Integer, required: true, validates: { numericality: { equal_to: 42 } } +# +# @example Require a real number +# +# argument :items_count, Integer, required: true, validates: { numericality: { greater_than_or_equal_to: 0 } } +# +# pkg:gem/graphql#lib/graphql/schema/validator/numericality_validator.rb:19 +class GraphQL::Schema::Validator::NumericalityValidator < ::GraphQL::Schema::Validator + # @param greater_than [Integer] + # @param greater_than_or_equal_to [Integer] + # @param less_than [Integer] + # @param less_than_or_equal_to [Integer] + # @param equal_to [Integer] + # @param other_than [Integer] + # @param odd [Boolean] + # @param even [Boolean] + # @param within [Range] + # @param message [String] used for all validation failures + # + # pkg:gem/graphql#lib/graphql/schema/validator/numericality_validator.rb:30 + def initialize(greater_than: T.unsafe(nil), greater_than_or_equal_to: T.unsafe(nil), less_than: T.unsafe(nil), less_than_or_equal_to: T.unsafe(nil), equal_to: T.unsafe(nil), other_than: T.unsafe(nil), odd: T.unsafe(nil), even: T.unsafe(nil), within: T.unsafe(nil), message: T.unsafe(nil), null_message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/numericality_validator.rb:54 + def validate(object, context, value); end +end + +# Use this validator to require _one_ of the named arguments to be present. +# Or, use Arrays of symbols to name a valid _set_ of arguments. +# +# (This is for specifying mutually exclusive sets of arguments.) +# +# If you use {GraphQL::Schema::Visibility} to hide all the arguments in a `one_of: [..]` set, +# then a developer-facing {GraphQL::Error} will be raised during execution. Pass `allow_all_hidden: true` to +# skip validation in this case instead. +# +# This validator also implements `argument ... required: :nullable`. If an argument has `required: :nullable` +# but it's hidden with {GraphQL::Schema::Visibility}, then this validator doesn't run. +# +# @example Require exactly one of these arguments +# +# field :update_amount, IngredientAmount, null: false do +# argument :ingredient_id, ID, required: true +# argument :cups, Integer, required: false +# argument :tablespoons, Integer, required: false +# argument :teaspoons, Integer, required: false +# validates required: { one_of: [:cups, :tablespoons, :teaspoons] } +# end +# +# @example Require one of these _sets_ of arguments +# +# field :find_object, Node, null: true do +# argument :node_id, ID, required: false +# argument :object_type, String, required: false +# argument :object_id, Integer, required: false +# # either a global `node_id` or an `object_type`/`object_id` pair is required: +# validates required: { one_of: [:node_id, [:object_type, :object_id]] } +# end +# +# @example require _some_ value for an argument, even if it's null +# field :update_settings, AccountSettings do +# # `required: :nullable` means this argument must be given, but may be `null` +# argument :age, Integer, required: :nullable +# end +# +# pkg:gem/graphql#lib/graphql/schema/validator/required_validator.rb:44 +class GraphQL::Schema::Validator::RequiredValidator < ::GraphQL::Schema::Validator + # @param one_of [Array] A list of arguments, exactly one of which is required for this field + # @param argument [Symbol] An argument that is required for this field + # @param allow_all_hidden [Boolean] If `true`, then this validator won't run if all the `one_of: ...` arguments have been hidden + # @param message [String] + # + # pkg:gem/graphql#lib/graphql/schema/validator/required_validator.rb:49 + def initialize(one_of: T.unsafe(nil), argument: T.unsafe(nil), allow_all_hidden: T.unsafe(nil), message: T.unsafe(nil), **default_options); end + + # pkg:gem/graphql#lib/graphql/schema/validator/required_validator.rb:158 + def arg_keyword_to_graphql_name(argument_definitions, arg_keyword); end + + # pkg:gem/graphql#lib/graphql/schema/validator/required_validator.rb:130 + def build_message(context); end + + # pkg:gem/graphql#lib/graphql/schema/validator/required_validator.rb:62 + def validate(_object, context, value); end +end + +# pkg:gem/graphql#lib/graphql/schema/validator.rb:116 +class GraphQL::Schema::Validator::ValidationFailedError < ::GraphQL::ExecutionError + # pkg:gem/graphql#lib/graphql/schema/validator.rb:119 + def initialize(errors:); end + + # pkg:gem/graphql#lib/graphql/schema/validator.rb:117 + def errors; end +end + +# Use this plugin to make some parts of your schema hidden from some viewers. +# +# pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:5 +class GraphQL::Schema::Visibility + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:29 + def initialize(schema, dynamic:, preload:, profiles:, migration_errors:, configuration_inherited: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:63 + def all_directives; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:68 + def all_interface_type_memberships; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:73 + def all_references; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:154 + def cached_profiles; end + + # Make another Visibility for `schema` based on this one + # @return [Visibility] + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:139 + def dup_for(other_schema); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:55 + def freeze; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:78 + def get_type(type_name); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:132 + def introspection_system_configured(introspection_system); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:150 + def migration_errors?; end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:117 + def mutation_configured(mutation_type); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:127 + def orphan_types_configured(orphan_types); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:89 + def preload; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:85 + def preload?; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:156 + def profile_for(context); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:112 + def query_configured(query_type); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:122 + def subscription_configured(subscription_type); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:180 + def top_level; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:185 + def top_level_profile(refresh: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:83 + def types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:83 + def types=(_arg0); end + + # @api private + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:183 + def unfiltered_interface_type_memberships; end + + private + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:207 + def ensure_all_loaded(types_to_visit); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:220 + def load_all(types: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:194 + def require_if_preloaded(config_message, config_code); end + + class << self + # @param schema [Class] + # @param profiles [Hash Hash>] A hash of `name => context` pairs for preloading visibility profiles + # @param preload [Boolean] if `true`, load the default schema profile and all named profiles immediately (defaults to `true` for `Rails.env.production?` and `Rails.env.staging?`) + # @param migration_errors [Boolean] if `true`, raise an error when `Visibility` and `Warden` return different results + # + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:21 + def use(schema, dynamic: T.unsafe(nil), profiles: T.unsafe(nil), preload: T.unsafe(nil), migration_errors: T.unsafe(nil)); end + end +end + +# You can use this to see how {GraphQL::Schema::Warden} and {GraphQL::Schema::Visibility::Profile} +# handle `.visible?` differently in your schema. +# +# It runs the same method on both implementations and raises an error when the results diverge. +# +# To fix the error, modify your schema so that both implementations return the same thing. +# Or, open an issue on GitHub to discuss the difference. +# +# This plugin adds overhead to runtime and may cause unexpected crashes -- **don't** use it in production! +# +# This plugin adds two keys to `context` when running: +# +# - `visibility_migration_running: true` +# - For the {Schema::Warden} which it instantiates, it adds `visibility_migration_warden_running: true`. +# +# Use those keys to modify your `visible?` behavior as needed. +# +# Also, in a pinch, you can set `skip_visibility_migration_error: true` in context to turn off this behavior per-query. +# (In that case, it uses {Profile} directly.) +# +# @example Adding this plugin +# +# use GraphQL::Schema::Visibility, migration_errors: true +# +# pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:29 +class GraphQL::Schema::Visibility::Migration < ::GraphQL::Schema::Visibility::Profile + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:79 + def initialize(context:, schema:, visibility:, name: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def all_types(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def all_types_h(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def argument(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def arguments(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:136 + def call_method_and_compare(method, args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def directive_exists?(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def directives(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def enum_values(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:154 + def equivalent_schema_members?(member1, member2); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def field(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def fields(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def interfaces(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def loadable?(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def loadable_possible_types(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:104 + def loaded_types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def mutation_root(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def possible_types(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def query_root(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def reachable_type?(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def subscription_root(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def type(*args); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:131 + def visible_enum_value?(*args); end +end + +# pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:108 +GraphQL::Schema::Visibility::Migration::PUBLIC_PROFILE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:30 +class GraphQL::Schema::Visibility::Migration::RuntimeTypesMismatchError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:31 + def initialize(method_called, warden_result, profile_result, method_args); end + + private + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:44 + def compare_results(warden_result, profile_result); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/migration.rb:63 + def humanize(val); end +end + +# This class filters the types, fields, arguments, enum values, and directives in a schema +# based on the given `context`. +# +# It's like {Warden}, but has some differences: +# +# - It doesn't use {Schema}'s top-level caches (eg {Schema.references_to}, {Schema.possible_types}, {Schema.types}) +# - It doesn't hide Interface or Union types when all their possible types are hidden. (Instead, those types should implement `.visible?` to hide in that case.) +# - It checks `.visible?` on root introspection types +# - It can be used to cache profiles by name for re-use across queries +# +# pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:15 +class GraphQL::Schema::Visibility::Profile + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:63 + def initialize(context:, schema:, visibility:, name: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:225 + def all_types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:230 + def all_types_h; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:178 + def argument(owner, arg_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:174 + def arguments(owner); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:239 + def directive_exists?(dir_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:243 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:235 + def enum_values(owner); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:166 + def field(owner, field_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:138 + def field_on_visible_interface?(field, owner); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:170 + def fields(owner); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:34 + def freeze; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:205 + def interfaces(obj_or_int_type); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:249 + def loadable?(t, _ctx); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:253 + def loadable_possible_types(t, _ctx); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:257 + def loaded_types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:217 + def mutation_root; end + + # @return [Symbol, nil] + # + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:32 + def name; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:201 + def possible_types(type); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:270 + def preload; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:213 + def query_root; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:261 + def reachable_type?(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:221 + def subscription_root; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:162 + def type(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:266 + def visible_enum_value?(enum_value, _ctx = T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:336 + def compute_field(owner, field_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:311 + def compute_type(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:384 + def load_all_types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:365 + def non_duplicate_items(definitions, visibility_cache); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:423 + def possible_types_for(type); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:380 + def raise_duplicate_definition(first_defn, second_defn); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:408 + def referenced?(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:457 + def visible_field_for(owner, field); end + + class << self + # @return [Schema::Visibility::Profile] + # + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:17 + def from_context(ctx, schema); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/profile.rb:25 + def null_profile(context:, schema:); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/visibility.rb:11 +class GraphQL::Schema::Visibility::TypeConfigurationError < ::GraphQL::Error + # pkg:gem/graphql#lib/graphql/schema/visibility.rb:12 + def initialize(config_message, config_str); end +end + +# pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:5 +class GraphQL::Schema::Visibility::Visit + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:6 + def initialize(schema, &visit_block); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:28 + def entry_point_directives; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:16 + def entry_point_types; end + + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:32 + def visit_each(types: T.unsafe(nil), directives: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:127 + def append_unvisited_type(owner, type); end + + # pkg:gem/graphql#lib/graphql/schema/visibility/visit.rb:135 + def update_type_owner(owner, type); end +end + +# Restrict access to a {GraphQL::Schema} with a user-defined `visible?` implementations. +# +# When validating and executing a query, all access to schema members +# should go through a warden. If you access the schema directly, +# you may show a client something that it shouldn't be allowed to see. +# +# @api private +# +# pkg:gem/graphql#lib/graphql/schema/warden.rb:14 +class GraphQL::Schema::Warden + # @param context [GraphQL::Query::Context] + # @param schema [GraphQL::Schema] + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:200 + def initialize(context:, schema:); end + + # @param argument_owner [GraphQL::Field, GraphQL::InputObjectType] + # @return [Array] Visible arguments on `argument_owner` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:318 + def arguments(argument_owner, ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:361 + def directives; end + + # @return [Array] Visible members of `enum_defn` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:333 + def enum_values(enum_defn); end + + # @param type_defn [GraphQL::ObjectType, GraphQL::InterfaceType] + # @return [Array] Fields on `type_defn` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:311 + def fields(type_defn); end + + # @return [GraphQL::Argument, nil] The argument named `argument_name` on `parent_type`, if it exists and is visible + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:295 + def get_argument(parent_type, argument_name); end + + # @return [GraphQL::Field, nil] The field named `field_name` on `parent_type`, if it exists + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:279 + def get_field(parent_type, field_name); end + + # @return [GraphQL::BaseType, nil] The type named `type_name`, if it exists (else `nil`) + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:254 + def get_type(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:398 + def interface_type_memberships(obj_type, _ctx = T.unsafe(nil)); end + + # @return [Array] Visible interfaces implemented by `obj_type` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:350 + def interfaces(obj_type); end + + # @return [Boolean] True if this type is used for `loads:` but not in the schema otherwise and not _explicitly_ hidden. + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:234 + def loadable?(type, _ctx); end + + # This abstract type was determined to be used for `loads` only. + # All its possible types are valid possibilities here -- no filtering. + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:242 + def loadable_possible_types(abstract_type, _ctx); end + + # @return [Array] The types which may be member of `type_defn` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:301 + def possible_types(type_defn); end + + # @return Boolean True if the type is visible and reachable in the schema + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:273 + def reachable_type?(type_name); end + + # @return [Array] Visible and reachable types in the schema + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:268 + def reachable_types; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:365 + def root_type_for_operation(op_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:218 + def skip_warning=(_arg0); end + + # @return [Hash] Visible types in the schema + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:221 + def types; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:116 + def visibility_profile; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:385 + def visible_argument?(arg_defn, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:344 + def visible_enum_value?(enum_value, _ctx = T.unsafe(nil)); end + + # @param owner [Class, Module] If provided, confirm that field has the given owner. + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:375 + def visible_field?(field_defn, _ctx = T.unsafe(nil), owner = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:389 + def visible_type?(type_defn, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:394 + def visible_type_membership?(type_membership, _ctx = T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:503 + def check_visible(schema, member); end + + # If this field was inherited from an interface, and the field on that interface is _hidden_, + # then treat this inherited field as hidden. + # (If it _wasn't_ inherited, then don't hide it for this reason.) + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:454 + def field_on_visible_interface?(field_defn, type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:491 + def orphan_type?(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:555 + def reachable_type_set; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:499 + def read_through; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:486 + def referenced?(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:480 + def root_type?(type_defn); end + + # We need this to tell whether a field was inherited by an interface + # even when that interface is hidden from `#interfaces` + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:446 + def unfiltered_interfaces(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:439 + def union_memberships(obj_type); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:495 + def visible?(member); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:407 + def visible_and_reachable_type?(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:593 + def visit_type(type, unvisited_types, visited_type_set, type_by_name_hash, included_interface_possible_types_set, include_interface_possible_types:); end + + class << self + # pkg:gem/graphql#lib/graphql/schema/warden.rb:15 + def from_context(context); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:22 + def types_from_context(context); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:29 + def use(schema); end + + # @param visibility_method [Symbol] a Warden method to call for this entry + # @param entry [Object, Array] One or more definitions for a given name in a GraphQL Schema + # @param context [GraphQL::Query::Context] + # @param warden [Warden] + # @return [Object] `entry` or one of `entry`'s items if exactly one of them is visible for this context + # @return [nil] If neither `entry` nor any of `entry`'s items are visible for this context + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:39 + def visible_entry?(visibility_method, entry, context, warden = T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/warden.rb:539 +GraphQL::Schema::Warden::ADD_WARDEN_WARNING = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/schema/warden.rb:82 +class GraphQL::Schema::Warden::NullWarden + # pkg:gem/graphql#lib/graphql/schema/warden.rb:83 + def initialize(_filter = T.unsafe(nil), context:, schema:); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:100 + def arguments(argument_owner, ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:105 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:101 + def enum_values(enum_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:106 + def fields(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:102 + def get_argument(parent_type, argument_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:107 + def get_field(parent_type, field_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:99 + def get_type(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:98 + def interface_type_memberships(obj_type, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:113 + def interfaces(obj_type); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:109 + def loadable?(type, _ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:110 + def loadable_possible_types(abstract_type, _ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:112 + def possible_types(type_defn); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:108 + def reachable_type?(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:111 + def reachable_types; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:104 + def root_type_for_operation(op_name); end + + # No-op, but for compatibility: + # + # pkg:gem/graphql#lib/graphql/schema/warden.rb:89 + def skip_warning=(_arg0); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:103 + def types; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:91 + def visibility_profile; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:94 + def visible_argument?(arg_defn, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:96 + def visible_enum_value?(enum_value, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:93 + def visible_field?(field_defn, _ctx = T.unsafe(nil), owner = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:95 + def visible_type?(type_defn, _ctx = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:97 + def visible_type_membership?(type_membership, _ctx = T.unsafe(nil)); end +end + +# This is used when a caller provides a Hash for context. +# We want to call the schema's hooks, but we don't have a full-blown warden. +# The `context` arguments to these methods exist purely to simplify the code that +# calls methods on this object, so it will have everything it needs. +# +# pkg:gem/graphql#lib/graphql/schema/warden.rb:65 +class GraphQL::Schema::Warden::PassThruWarden + class << self + # pkg:gem/graphql#lib/graphql/schema/warden.rb:73 + def arguments(owner, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:72 + def interface_type_memberships(obj_t, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:74 + def loadable?(type, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:75 + def loadable_possible_types(type, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:76 + def visibility_profile; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:68 + def visible_argument?(arg, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:70 + def visible_enum_value?(ev, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:67 + def visible_field?(field, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:69 + def visible_type?(type, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:71 + def visible_type_membership?(tm, ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/schema/warden.rb:120 +class GraphQL::Schema::Warden::VisibilityProfile + # pkg:gem/graphql#lib/graphql/schema/warden.rb:121 + def initialize(warden); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:173 + def all_types; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:141 + def argument(owner, arg_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:157 + def arguments(owner); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:129 + def directive_exists?(dir_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:125 + def directives; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:169 + def enum_values(enum_type); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:137 + def field(owner, field_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:161 + def fields(owner); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:177 + def interfaces(obj_type); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:181 + def loadable?(t, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:185 + def loadable_possible_types(t, ctx); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:149 + def mutation_root; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:165 + def possible_types(type); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:145 + def query_root; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:189 + def reachable_type?(type_name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:153 + def subscription_root; end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:133 + def type(name); end + + # pkg:gem/graphql#lib/graphql/schema/warden.rb:193 + def visible_enum_value?(enum_value, ctx = T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/schema/wrapper.rb:5 +class GraphQL::Schema::Wrapper + include ::GraphQL::Schema::Member::TypeSystemHelpers + + # pkg:gem/graphql#lib/graphql/schema/wrapper.rb:11 + def initialize(of_type); end + + # pkg:gem/graphql#lib/graphql/schema/wrapper.rb:25 + def ==(other); end + + # pkg:gem/graphql#lib/graphql/schema/wrapper.rb:19 + def freeze; end + + # @return [Class, Module] The inner type of this wrapping type, the type of which one or more objects may be present. + # + # pkg:gem/graphql#lib/graphql/schema/wrapper.rb:9 + def of_type; end + + # pkg:gem/graphql#lib/graphql/schema/wrapper.rb:15 + def unwrap; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/error.rb:3 +module GraphQL::StaticValidation; end + +# Default rules for {GraphQL::StaticValidation::Validator} +# +# Order is important here. Some validators skip later hooks. +# which stops the visit on that node. That way it doesn't try to find fields on types that +# don't exist, etc. +# +# pkg:gem/graphql#lib/graphql/static_validation/all_rules.rb:9 +GraphQL::StaticValidation::ALL_RULES = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible.rb:4 +module GraphQL::StaticValidation::ArgumentLiteralsAreCompatible + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible.rb:5 + def on_argument(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:4 +class GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:10 + def initialize(message, type:, path: T.unsafe(nil), nodes: T.unsafe(nil), argument_name: T.unsafe(nil), extensions: T.unsafe(nil), coerce_extensions: T.unsafe(nil), argument: T.unsafe(nil), value: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:7 + def argument; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:6 + def argument_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:43 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:21 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:5 + def type_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb:8 + def value; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique.rb:4 +module GraphQL::StaticValidation::ArgumentNamesAreUnique + include ::GraphQL::StaticValidation::Error::ErrorHelper + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique.rb:12 + def on_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique.rb:7 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique.rb:17 + def validate_arguments(node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique_error.rb:4 +class GraphQL::StaticValidation::ArgumentNamesAreUniqueError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique_error.rb:7 + def initialize(message, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique_error.rb:5 + def name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/argument_names_are_unique_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined.rb:4 +module GraphQL::StaticValidation::ArgumentsAreDefined + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined.rb:5 + def on_argument(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined.rb:47 + def node_type(parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined.rb:51 + def parent_definition(parent); end + + # TODO smell: these methods are added to all visitors, since they're included in a module. + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined.rb:34 + def parent_name(parent, type_defn); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:4 +class GraphQL::StaticValidation::ArgumentsAreDefinedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:10 + def initialize(message, name:, type:, argument_name:, parent:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:7 + def argument_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:32 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:5 + def name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:8 + def parent; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:19 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/arguments_are_defined_error.rb:6 + def type_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:4 +class GraphQL::StaticValidation::BaseVisitor < ::GraphQL::Language::StaticVisitor + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:5 + def initialize(document, context); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:22 + def context; end + + # @return [Array] The nesting of the current position in the AST + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:25 + def path; end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:215 + def add_error(error, path: T.unsafe(nil)); end + + class << self + # Build a class to visit the AST and perform validation, + # or use a pre-built class if rules is `ALL_RULES` or empty. + # @param rules [Array] + # @return [Class] A class for validating `rules` during visitation + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:33 + def including_rules(rules); end + end +end + +# pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:56 +module GraphQL::StaticValidation::BaseVisitor::ContextMethods + # @return [GraphQL::Argument, nil] The most-recently-entered GraphQL::Argument, if currently inside one + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:204 + def argument_definition; end + + # @return [GraphQL::Directive, nil] The most-recently-entered GraphQL::Directive, if currently inside one + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:199 + def directive_definition; end + + # @return [GraphQL::Field, nil] The most-recently-entered GraphQL::Field, if currently inside one + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:194 + def field_definition; end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:137 + def on_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:129 + def on_directive(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:108 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:70 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:164 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:89 + def on_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:171 + def on_input_object(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:57 + def on_operation_definition(node, parent); end + + # @return [GraphQL::BaseType] The type which the current type came from + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:189 + def parent_type_definition; end + + # @return [GraphQL::BaseType] The current object type + # + # pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:184 + def type_definition; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/base_visitor.rb:87 +GraphQL::StaticValidation::BaseVisitor::ContextMethods::INLINE_FRAGMENT_NO_TYPE = T.let(T.unsafe(nil), String) + +# Track fragment dependencies for operations +# and expose the fragment definitions which +# are used by a given operation +# +# pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:7 +module GraphQL::StaticValidation::DefinitionDependencies + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:10 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:8 + def dependencies; end + + # A map of operation definitions to an array of that operation's dependencies + # @return [DependencyMap] + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:69 + def dependency_map(&block); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:32 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:51 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:58 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:44 + def on_operation_definition(node, prev_node); end + + private + + # Return a hash of { node => [node, node ... ]} pairs + # Keys are top-level definitions + # Values are arrays of flattened dependencies + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:114 + def resolve_dependencies; end +end + +# Map definition AST nodes to the definition AST nodes they depend on. +# Expose circular dependencies. +# +# pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:75 +class GraphQL::StaticValidation::DefinitionDependencies::DependencyMap + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:85 + def initialize; end + + # @return [Array] dependencies for `definition_node` + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:93 + def [](definition_node); end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:77 + def cyclical_definitions; end + + # @return [Hash>] + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:80 + def unmet_dependencies; end + + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:83 + def unused_dependencies; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:98 +class GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:101 + def initialize(node, path); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:106 + def eql?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:106 + def hash(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:106 + def name(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:100 + def node; end + + # pkg:gem/graphql#lib/graphql/static_validation/definition_dependencies.rb:100 + def path; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined.rb:4 +module GraphQL::StaticValidation::DirectivesAreDefined + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined.rb:5 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined.rb:9 + def on_directive(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined_error.rb:4 +class GraphQL::StaticValidation::DirectivesAreDefinedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined_error.rb:7 + def initialize(message, directive:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined_error.rb:5 + def directive_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_defined_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:4 +module GraphQL::StaticValidation::DirectivesAreInValidLocations + include ::GraphQL::Language + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:7 + def on_directive(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:53 + def assert_includes_location(directive_defn, directive_ast, required_location); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:35 + def validate_location(ast_directive, ast_parent, directives); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:14 +GraphQL::StaticValidation::DirectivesAreInValidLocations::LOCATION_MESSAGE_NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:25 +GraphQL::StaticValidation::DirectivesAreInValidLocations::SIMPLE_LOCATIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb:33 +GraphQL::StaticValidation::DirectivesAreInValidLocations::SIMPLE_LOCATION_NODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:4 +class GraphQL::StaticValidation::DirectivesAreInValidLocationsError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:8 + def initialize(message, target:, path: T.unsafe(nil), nodes: T.unsafe(nil), name: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:26 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:6 + def name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:5 + def target_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb:15 + def to_h; end +end + +# Generates GraphQL-compliant validation message. +# +# pkg:gem/graphql#lib/graphql/static_validation/error.rb:5 +class GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:19 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:16 + def message; end + + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:33 + def nodes; end + + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:17 + def path; end + + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:17 + def path=(_arg0); end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:26 + def to_h; end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:37 + def locations; end +end + +# Convenience for validators +# +# pkg:gem/graphql#lib/graphql/static_validation/error.rb:7 +module GraphQL::StaticValidation::Error::ErrorHelper + # Error `error_message` is located at `node` + # + # pkg:gem/graphql#lib/graphql/static_validation/error.rb:9 + def error(error_message, nodes, context: T.unsafe(nil), path: T.unsafe(nil), extensions: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:4 +module GraphQL::StaticValidation::FieldsAreDefinedOnType + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:5 + def on_field(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type.rb:35 + def possible_fields(context, parent_type); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:4 +class GraphQL::StaticValidation::FieldsAreDefinedOnTypeError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:8 + def initialize(message, type:, field:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:27 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:6 + def field_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:15 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb:5 + def type_name; end +end + +# Scalars _can't_ have selections +# Objects _must_ have selections +# +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:6 +module GraphQL::StaticValidation::FieldsHaveAppropriateSelections + include ::GraphQL::StaticValidation::Error::ErrorHelper + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:9 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:15 + def on_operation_definition(node, _parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:24 + def validate_field_selections(ast_node, resolved_type); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:4 +class GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:8 + def initialize(message, node_name:, path: T.unsafe(nil), nodes: T.unsafe(nil), type: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:26 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:6 + def node_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:15 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb:5 + def type_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:6 +module GraphQL::StaticValidation::FieldsWillMerge + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:38 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:59 + def on_field(node, _parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:52 + def on_operation_definition(node, _parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:443 + def cached_sub_fields(node, return_type); end + + # Collect all fields from selections, expanding fragment spreads inline. + # Returns a Hash of { response_key => Field | [Field, ...] } + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:131 + def collect_fields(selections, owner_type:, parents:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:137 + def collect_fields_inner(selections, owner_type:, parents:, response_keys:, visited_fragments:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:108 + def conflicts; end + + # Core algorithm: collect ALL fields (expanding fragments inline) into a flat + # map keyed by response key, then compare within each group. + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:118 + def conflicts_within_selection_set(node, parent_type); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:291 + def field_signature(field); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:282 + def fields_same_signature?(f1, f2); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:303 + def find_conflict(response_key, field1, field2, mutually_exclusive: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:457 + def find_conflicts_between(response_keys, response_keys2, mutually_exclusive:); end + + # When two fields with the same response key both have sub-selections, + # we need to check those sub-selections against each other. + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:413 + def find_conflicts_between_sub_selection_sets(field1, field2, mutually_exclusive:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:198 + def find_conflicts_within(response_keys); end + + # Given two list of parents, find out if they are mutually exclusive + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:512 + def mutually_exclusive?(parents1, parents2); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:387 + def return_types_conflict?(type1, type2); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:478 + def same_arguments?(field1, field2); end + + # Quick check: can the direct children of this selection set possibly conflict? + # If all direct selections are Fields with unique names and no aliases, + # and there are no fragments, then no response key can have >1 field, + # so there are no merge conflicts to check at this level. + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:74 + def selections_may_conflict?(selections); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:492 + def serialize_arg(arg_value); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:503 + def serialize_field_args(field); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:547 + def types_mutually_exclusive?(type1, type2); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:19 +class GraphQL::StaticValidation::FieldsWillMerge::Field + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:22 + def initialize(node, definition, owner_type, parents); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:20 + def definition; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:20 + def node; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:20 + def owner_type; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:20 + def parents; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:29 + def return_type; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:33 + def unwrapped_return_type; end +end + +# Validates that a selection set is valid if all fields (including spreading any +# fragments) either correspond to distinct response names or can be merged +# without ambiguity. +# +# Optimized algorithm based on: +# https://tech.new-work.se/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01 +# +# Instead of comparing fields, fields-vs-fragments, and fragments-vs-fragments +# separately (which leads to exponential recursion through nested fragments), +# we flatten all fragment spreads into a single field map and compare within it. +# +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge.rb:17 +GraphQL::StaticValidation::FieldsWillMerge::NO_ARGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:4 +class GraphQL::StaticValidation::FieldsWillMergeError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:8 + def initialize(kind:, field_name:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:30 + def add_conflict(node, conflict_str); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:56 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:26 + def conflicts; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:5 + def field_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:6 + def kind; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:16 + def message; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:20 + def message=(_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:22 + def path; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fields_will_merge_error.rb:44 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique.rb:4 +module GraphQL::StaticValidation::FragmentNamesAreUnique + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique.rb:6 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique.rb:16 + def on_document(_n, _p); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique.rb:11 + def on_fragment_definition(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb:4 +class GraphQL::StaticValidation::FragmentNamesAreUniqueError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb:7 + def initialize(message, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb:5 + def fragment_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:4 +module GraphQL::StaticValidation::FragmentSpreadsArePossible + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:5 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:25 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:19 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:10 + def on_inline_fragment(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:42 + def validate_fragment_in_scope(parent_type, child_type, node, context, path); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:63 +class GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:65 + def initialize(node:, parent_type:, path:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:64 + def node; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:64 + def parent_type; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:64 + def path; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:4 +class GraphQL::StaticValidation::FragmentSpreadsArePossibleError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:9 + def initialize(message, type:, fragment_name:, parent:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:30 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:6 + def fragment_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:7 + def parent_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:17 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb:5 + def type_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist.rb:4 +module GraphQL::StaticValidation::FragmentTypesExist + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist.rb:5 + def on_fragment_definition(node, _parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist.rb:11 + def on_inline_fragment(node, _parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist.rb:19 + def validate_type_exists(fragment_node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist_error.rb:4 +class GraphQL::StaticValidation::FragmentTypesExistError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist_error.rb:7 + def initialize(message, type:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist_error.rb:24 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist_error.rb:13 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragment_types_exist_error.rb:5 + def type_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite.rb:4 +module GraphQL::StaticValidation::FragmentsAreFinite + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite.rb:5 + def on_document(_n, _p); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite_error.rb:4 +class GraphQL::StaticValidation::FragmentsAreFiniteError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite_error.rb:7 + def initialize(message, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite_error.rb:5 + def fragment_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_finite_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named.rb:4 +module GraphQL::StaticValidation::FragmentsAreNamed + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named.rb:5 + def on_fragment_definition(node, _parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named_error.rb:4 +class GraphQL::StaticValidation::FragmentsAreNamedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named_error.rb:6 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named_error.rb:21 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_named_error.rb:11 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:4 +module GraphQL::StaticValidation::FragmentsAreOnCompositeTypes + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:5 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:9 + def on_inline_fragment(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb:15 + def validate_type_is_composite(node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:4 +class GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:8 + def initialize(message, type:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:6 + def argument_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:25 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:14 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb:5 + def type_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used.rb:4 +module GraphQL::StaticValidation::FragmentsAreUsed + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used.rb:5 + def on_document(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used_error.rb:4 +class GraphQL::StaticValidation::FragmentsAreUsedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used_error.rb:7 + def initialize(message, fragment:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used_error.rb:5 + def fragment_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/fragments_are_used_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique.rb:4 +module GraphQL::StaticValidation::InputObjectNamesAreUnique + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique.rb:5 + def on_input_object(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique.rb:12 + def validate_input_fields(node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb:4 +class GraphQL::StaticValidation::InputObjectNamesAreUniqueError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb:7 + def initialize(message, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb:5 + def name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/interpreter_visitor.rb:4 +class GraphQL::StaticValidation::InterpreterVisitor < ::GraphQL::StaticValidation::BaseVisitor + include ::GraphQL::StaticValidation::DefinitionDependencies + include ::GraphQL::StaticValidation::OneOfInputObjectsAreValid + include ::GraphQL::StaticValidation::InputObjectNamesAreUnique + include ::GraphQL::StaticValidation::SubscriptionRootExistsAndSingleSubscriptionSelection + include ::GraphQL::StaticValidation::QueryRootExists + include ::GraphQL::StaticValidation::MutationRootExists + include ::GraphQL::StaticValidation::VariableUsagesAreAllowed + include ::GraphQL::StaticValidation::VariablesAreUsedAndDefined + include ::GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped + include ::GraphQL::StaticValidation::VariablesAreInputTypes + include ::GraphQL::StaticValidation::VariableNamesAreUnique + include ::GraphQL::StaticValidation::Error::ErrorHelper + include ::GraphQL::StaticValidation::ArgumentNamesAreUnique + include ::GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent + include ::GraphQL::StaticValidation::RequiredArgumentsArePresent + include ::GraphQL::StaticValidation::ArgumentLiteralsAreCompatible + include ::GraphQL::StaticValidation::ArgumentsAreDefined + include ::GraphQL::StaticValidation::FieldsHaveAppropriateSelections + include ::GraphQL::StaticValidation::FieldsWillMerge + include ::GraphQL::StaticValidation::FieldsAreDefinedOnType + include ::GraphQL::StaticValidation::FragmentSpreadsArePossible + include ::GraphQL::StaticValidation::FragmentsAreOnCompositeTypes + include ::GraphQL::StaticValidation::FragmentTypesExist + include ::GraphQL::StaticValidation::FragmentsAreUsed + include ::GraphQL::StaticValidation::FragmentsAreNamed + include ::GraphQL::StaticValidation::FragmentsAreFinite + include ::GraphQL::StaticValidation::FragmentNamesAreUnique + include ::GraphQL::StaticValidation::OperationNamesAreValid + include ::GraphQL::StaticValidation::UniqueDirectivesPerLocation + include ::GraphQL::Language + include ::GraphQL::StaticValidation::DirectivesAreInValidLocations + include ::GraphQL::StaticValidation::DirectivesAreDefined + include ::GraphQL::StaticValidation::NoDefinitionsArePresent + include ::GraphQL::StaticValidation::BaseVisitor::ContextMethods +end + +# Test whether `ast_value` is a valid input for `type` +# +# pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:5 +class GraphQL::StaticValidation::LiteralValidator + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:6 + def initialize(context:); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:13 + def validate(ast_value, type); end + + private + + # The GraphQL grammar supports variables embedded within scalars but graphql.js + # doesn't support it so we won't either for simplicity + # + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:97 + def constant_scalar?(ast_value); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:143 + def ensure_array(value); end + + # When `error_bubbling` is false, we want to bail on the first failure that we find. + # Use `throw` to escape the current call stack, returning the invalid response. + # + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:86 + def maybe_raise_if_invalid(ast_value); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:147 + def merge_results(results_list); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:132 + def present_input_field_values_are_valid(type, ast_node); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:34 + def recursively_validate(ast_value, type); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:21 + def replace_nulls_in(ast_value); end + + # pkg:gem/graphql#lib/graphql/static_validation/literal_validator.rb:109 + def required_input_fields_are_present(type, ast_node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists.rb:4 +module GraphQL::StaticValidation::MutationRootExists + # pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists.rb:5 + def on_operation_definition(node, _parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists_error.rb:4 +class GraphQL::StaticValidation::MutationRootExistsError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists_error.rb:6 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists_error.rb:21 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/mutation_root_exists_error.rb:11 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:4 +module GraphQL::StaticValidation::NoDefinitionsArePresent + include ::GraphQL::StaticValidation::Error::ErrorHelper + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:7 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:17 + def on_directive_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:33 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:24 + def on_enum_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:31 + def on_enum_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:21 + def on_input_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:28 + def on_input_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:22 + def on_interface_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:29 + def on_interface_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:12 + def on_invalid_node(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:20 + def on_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:27 + def on_object_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:19 + def on_scalar_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:26 + def on_scalar_type_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:18 + def on_schema_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:25 + def on_schema_extension(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:23 + def on_union_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present.rb:30 + def on_union_type_extension(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present_error.rb:4 +class GraphQL::StaticValidation::NoDefinitionsArePresentError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present_error.rb:5 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present_error.rb:20 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/no_definitions_are_present_error.rb:10 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/not_single_subscription_error.rb:4 +class GraphQL::StaticValidation::NotSingleSubscriptionError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/not_single_subscription_error.rb:5 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/not_single_subscription_error.rb:20 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/not_single_subscription_error.rb:10 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb:4 +module GraphQL::StaticValidation::OneOfInputObjectsAreValid + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb:5 + def on_input_object(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb:17 + def validate_one_of_input_object(ast_node, context, parent_type); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb:4 +class GraphQL::StaticValidation::OneOfInputObjectsAreValidError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb:7 + def initialize(message, path:, nodes:, input_object_type:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb:5 + def input_object_type; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid.rb:4 +module GraphQL::StaticValidation::OperationNamesAreValid + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid.rb:5 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid.rb:15 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid.rb:10 + def on_operation_definition(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid_error.rb:4 +class GraphQL::StaticValidation::OperationNamesAreValidError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid_error.rb:7 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil), name: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid_error.rb:23 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid_error.rb:5 + def operation_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/operation_names_are_valid_error.rb:13 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists.rb:4 +module GraphQL::StaticValidation::QueryRootExists + # pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists.rb:5 + def on_operation_definition(node, _parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists_error.rb:4 +class GraphQL::StaticValidation::QueryRootExistsError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists_error.rb:6 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists_error.rb:21 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/query_root_exists_error.rb:11 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present.rb:4 +module GraphQL::StaticValidation::RequiredArgumentsArePresent + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present.rb:5 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present.rb:15 + def on_directive(node, _parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present.rb:10 + def on_field(node, _parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present.rb:23 + def assert_required_args(ast_node, defn); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:4 +class GraphQL::StaticValidation::RequiredArgumentsArePresentError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:9 + def initialize(message, class_name:, name:, arguments:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:7 + def arguments; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:5 + def class_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:30 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:6 + def name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_arguments_are_present_error.rb:17 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb:4 +module GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb:5 + def on_input_object(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb:14 + def get_parent_type(context, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb:33 + def validate_input_object(ast_node, context, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:4 +class GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:9 + def initialize(message, path:, nodes:, argument_type:, argument_name:, input_object_type:); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:6 + def argument_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:5 + def argument_type; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:30 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:7 + def input_object_type; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb:17 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb:4 +module GraphQL::StaticValidation::SubscriptionRootExistsAndSingleSubscriptionSelection + # pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb:5 + def on_operation_definition(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_error.rb:4 +class GraphQL::StaticValidation::SubscriptionRootExistsError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_error.rb:6 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_error.rb:21 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/subscription_root_exists_error.rb:11 + def to_h; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:4 +module GraphQL::StaticValidation::UniqueDirectivesPerLocation + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_enum_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_enum_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_field(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_field_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_fragment_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_inline_fragment(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_input_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_input_value_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_interface_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_object_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_operation_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_scalar_type_definition(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:32 + def on_union_type_definition(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:37 + def validate_directive_location(node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:5 +GraphQL::StaticValidation::UniqueDirectivesPerLocation::DIRECTIVE_NODE_HOOKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location.rb:22 +GraphQL::StaticValidation::UniqueDirectivesPerLocation::VALIDATE_DIRECTIVE_LOCATION_ON_NODE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location_error.rb:4 +class GraphQL::StaticValidation::UniqueDirectivesPerLocationError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location_error.rb:7 + def initialize(message, directive:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location_error.rb:24 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location_error.rb:5 + def directive_name; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/unique_directives_per_location_error.rb:13 + def to_h; end +end + +# The validation context gets passed to each validator. +# +# It exposes a {GraphQL::Language::Visitor} where validators may add hooks. ({Language::Visitor#visit} is called in {Validator#validate}) +# +# It provides access to the schema & fragments which validators may read from. +# +# It holds a list of errors which each validator may add to. +# +# pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:11 +class GraphQL::StaticValidation::ValidationContext + extend ::Forwardable + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:21 + def initialize(query, visitor_class, max_errors); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def argument_definition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def dependencies(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:53 + def did_you_mean_suggestion(name, options); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def directive_definition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:19 + def document(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def errors; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def field_definition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:19 + def fragments(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def max_errors; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:37 + def on_dependency_resolve(&handler); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def on_dependency_resolve_handlers; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:19 + def operations(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def parent_type_definition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def path(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def query; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def schema; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:49 + def schema_directives; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:45 + def too_many_errors?; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:33 + def type_definition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def types; end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:41 + def validate_literal(ast_value, type); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_context.rb:14 + def visitor; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/validation_timeout_error.rb:4 +class GraphQL::StaticValidation::ValidationTimeoutError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/validation_timeout_error.rb:5 + def initialize(message, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/validation_timeout_error.rb:20 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/validation_timeout_error.rb:10 + def to_h; end +end + +# Initialized with a {GraphQL::Schema}, then it can validate {GraphQL::Language::Nodes::Documents}s based on that schema. +# +# By default, it's used by {GraphQL::Query} +# +# @example Validate a query +# validator = GraphQL::StaticValidation::Validator.new(schema: MySchema) +# query = GraphQL::Query.new(MySchema, query_string) +# errors = validator.validate(query)[:errors] +# +# pkg:gem/graphql#lib/graphql/static_validation/validator.rb:15 +class GraphQL::StaticValidation::Validator + # @param schema [GraphQL::Schema] + # @param rules [Array<#validate(context)>] a list of rules to use when validating + # + # pkg:gem/graphql#lib/graphql/static_validation/validator.rb:18 + def initialize(schema:, rules: T.unsafe(nil)); end + + # Invoked when static validation times out. + # @param query [GraphQL::Query] + # @param context [GraphQL::StaticValidation::ValidationContext] + # + # pkg:gem/graphql#lib/graphql/static_validation/validator.rb:75 + def handle_timeout(query, context); end + + # Validate `query` against the schema. Returns an array of message hashes. + # @param query [GraphQL::Query] + # @param validate [Boolean] + # @param timeout [Float] Number of seconds to wait before aborting validation. Any positive number may be used, including Floats to specify fractional seconds. + # @param max_errors [Integer] Maximum number of errors before aborting validation. Any positive number will limit the number of errors. Defaults to nil for no limit. + # @return [Array] + # + # pkg:gem/graphql#lib/graphql/static_validation/validator.rb:29 + def validate(query, validate: T.unsafe(nil), timeout: T.unsafe(nil), max_errors: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb:4 +module GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb:5 + def on_variable_definition(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:4 +class GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:14 + def initialize(message, name:, error_type:, path: T.unsafe(nil), nodes: T.unsafe(nil), type: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:34 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:23 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:6 + def type_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:5 + def variable_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:7 + def violation; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb:9 +GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError::VIOLATIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique.rb:4 +module GraphQL::StaticValidation::VariableNamesAreUnique + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique.rb:5 + def on_operation_definition(node, parent); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique_error.rb:4 +class GraphQL::StaticValidation::VariableNamesAreUniqueError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique_error.rb:7 + def initialize(message, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique_error.rb:24 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique_error.rb:13 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_names_are_unique_error.rb:5 + def variable_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:4 +module GraphQL::StaticValidation::VariableUsagesAreAllowed + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:5 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:16 + def on_argument(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:11 + def on_operation_definition(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:91 + def create_error(error_message, var_type, ast_var, arg_defn, arg_node); end + + # @return [Integer] Returns the max depth of `array`, or `0` if it isn't an array at all + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:117 + def depth_of_array(array); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:133 + def list_dimension(type); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:143 + def non_null_levels_match(arg_type, var_type); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:54 + def validate_usage(argument_owner, arg_node, ast_var); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:102 + def wrap_var_type_with_depth_of_arg(var_type, arg_node); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:4 +class GraphQL::StaticValidation::VariableUsagesAreAllowedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:10 + def initialize(message, type:, name:, argument:, error:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:7 + def argument_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:33 + def code; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:8 + def error_message; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:19 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:5 + def type_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb:6 + def variable_name; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types.rb:4 +module GraphQL::StaticValidation::VariablesAreInputTypes + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types.rb:5 + def on_variable_definition(node, parent); end + + private + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types.rb:42 + def get_type_name(ast_type); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:4 +class GraphQL::StaticValidation::VariablesAreInputTypesError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:8 + def initialize(message, type:, name:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:27 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:15 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:5 + def type_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_input_types_error.rb:6 + def variable_name; end +end + +# The problem is +# - Variable $usage must be determined at the OperationDefinition level +# - You can't tell how fragments use variables until you visit FragmentDefinitions (which may be at the end of the document) +# +# So, this validator includes some crazy logic to follow fragment spreads recursively, while avoiding infinite loops. +# +# `graphql-js` solves this problem by: +# - re-visiting the AST for each validator +# - allowing validators to say `followSpreads: true` +# +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:14 +module GraphQL::StaticValidation::VariablesAreUsedAndDefined + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:26 + def initialize(*_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:78 + def on_document(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:48 + def on_fragment_definition(node, parent); end + + # For FragmentSpreads: + # - find the context on the stack + # - mark the context as containing this spread + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:59 + def on_fragment_spread(node, parent); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:33 + def on_operation_definition(node, parent); end + + # For VariableIdentifiers: + # - mark the variable as used + # - assign its AST node + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:68 + def on_variable_identifier(node, parent); end + + private + + # Determine all the error messages, + # Then push messages into the validation context + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:124 + def create_errors(node_variables); end + + # Follow spreads in `node`, looking them up from `spreads_for_context` and finding their match in `fragment_definitions`. + # Use those fragments to update {VariableUsage}s in `parent_variables`. + # Avoid infinite loops by skipping anything in `visited_fragments`. + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:94 + def follow_spreads(node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:15 +class GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def ast_node; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def ast_node=(_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:21 + def declared?; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def declared_by; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def declared_by=(_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def path; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def path=(_arg0); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:17 + def used?; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def used_by; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:16 + def used_by=(_arg0); end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:4 +class GraphQL::StaticValidation::VariablesAreUsedAndDefinedError < ::GraphQL::StaticValidation::Error + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:13 + def initialize(message, name:, error_type:, path: T.unsafe(nil), nodes: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:32 + def code; end + + # A hash representation of this Message + # + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:21 + def to_h; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:5 + def variable_name; end + + # pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:6 + def violation; end +end + +# pkg:gem/graphql#lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb:8 +GraphQL::StaticValidation::VariablesAreUsedAndDefinedError::VIOLATIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/string_encoding_error.rb:3 +class GraphQL::StringEncodingError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/string_encoding_error.rb:5 + def initialize(str, context:); end + + # pkg:gem/graphql#lib/graphql/string_encoding_error.rb:4 + def field; end + + # pkg:gem/graphql#lib/graphql/string_encoding_error.rb:4 + def path; end + + # pkg:gem/graphql#lib/graphql/string_encoding_error.rb:4 + def string; end +end + +# pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:4 +class GraphQL::Subscriptions + # @param schema [Class] the GraphQL schema this manager belongs to + # @param validate_update [Boolean] If false, then validation is skipped when executing updates + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:40 + def initialize(schema:, validate_update: T.unsafe(nil), broadcast: T.unsafe(nil), default_broadcastable: T.unsafe(nil), **rest); end + + # @return [Boolean] if true, then a query like this one would be broadcasted + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:233 + def broadcastable?(query_str, **query_options); end + + # @return [String] A new unique identifier for a subscription + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:216 + def build_id; end + + # @return [Boolean] Used when fields don't have `broadcastable:` explicitly set + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:50 + def default_broadcastable; end + + # A subscription was terminated server-side. + # Clean up the database. + # @param subscription_id [String] + # @return void. + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:211 + def delete_subscription(subscription_id); end + + # A subscription query was re-evaluated, returning `result`. + # The result should be send to `subscription_id`. + # @param subscription_id [String] + # @param result [Hash] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:194 + def deliver(subscription_id, result); end + + # Run the update query for this subscription and deliver it + # @see {#execute_update} + # @see {#deliver} + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:158 + def execute(subscription_id, event, object); end + + # Event `event` occurred on `object`, + # Update all subscribers. + # @param event [Subscriptions::Event] + # @param object [Object] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:177 + def execute_all(event, object); end + + # `event` was triggered on `object`, and `subscription_id` was subscribed, + # so it should be updated. + # + # Load `subscription_id`'s GraphQL data, re-evaluate the query and return the result. + # + # @param subscription_id [String] + # @param event [GraphQL::Subscriptions::Event] The event which was triggered + # @param object [Object] The value for the subscription field + # @return [GraphQL::Query::Result] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:104 + def execute_update(subscription_id, event, object); end + + # pkg:gem/graphql#lib/graphql/subscriptions.rb:262 + def finalizer; end + + # Called during execution when a subscription operation has finished + # @param query [GraphQL::Query] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:255 + def finish_subscriptions(query); end + + # Called during execution when a new `subscription ...` operation is received + # @param query [GraphQL::Query] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:245 + def initialize_subscriptions(query); end + + # Convert a user-provided event name or argument + # to the equivalent in GraphQL. + # + # By default, it converts the identifier to camelcase. + # Override this in a subclass to change the transformation. + # + # @param event_or_arg_name [String, Symbol] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:228 + def normalize_name(event_or_arg_name); end + + # The system wants to send an update to this subscription. + # Read its data and return it. + # @param subscription_id [String] + # @return [Hash] Containing required keys + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:185 + def read_subscription(subscription_id); end + + # Fetch subscriptions matching this field + arguments pair + # And pass them off to the queue. + # @param event_name [String] + # @param args [Hash Object] + # @param object [Object] + # @param scope [Symbol, String] + # @param context [Hash] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:60 + def trigger(event_name, args, object, scope: T.unsafe(nil), context: T.unsafe(nil)); end + + # Define this method to customize whether to validate + # this subscription when executing an update. + # + # @return [Boolean] defaults to `true`, or false if `validate: false` is provided. + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:150 + def validate_update?(query:, context:, root_value:, subscription_topic:, operation_name:, variables:); end + + # `query` was executed and found subscriptions to `events`. + # Update the database to reflect this new state. + # @param query [GraphQL::Query] + # @param events [Array] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:203 + def write_subscription(query, events); end + + private + + # Recursively normalize `args` as belonging to `arg_owner`: + # - convert symbols to strings, + # - if needed, camelize the string (using {#normalize_name}) + # @param arg_owner [GraphQL::Field, GraphQL::BaseType] + # @param args [Hash, Array, Any] some GraphQL input value to coerce as `arg_owner` + # @return [Any] normalized arguments value + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:285 + def normalize_arguments(event_name, arg_owner, args, context); end + + class << self + # @see {Subscriptions#initialize} for options, concrete implementations may add options. + # + # pkg:gem/graphql#lib/graphql/subscriptions.rb:25 + def use(defn, options = T.unsafe(nil)); end + end +end + +# A subscriptions implementation that sends data +# as ActionCable broadcastings. +# +# Some things to keep in mind: +# +# - No queueing system; ActiveJob should be added +# - Take care to reload context when re-delivering the subscription. (see {Query#subscription_update?}) +# - Avoid the async ActionCable adapter and use the redis or PostgreSQL adapters instead. Otherwise calling #trigger won't work from background jobs or the Rails console. +# +# @example Adding ActionCableSubscriptions to your schema +# class MySchema < GraphQL::Schema +# # ... +# use GraphQL::Subscriptions::ActionCableSubscriptions +# end +# +# @example Implementing a channel for GraphQL Subscriptions +# class GraphqlChannel < ApplicationCable::Channel +# def subscribed +# @subscription_ids = [] +# end +# +# def execute(data) +# query = data["query"] +# variables = ensure_hash(data["variables"]) +# operation_name = data["operationName"] +# context = { +# # Re-implement whatever context methods you need +# # in this channel or ApplicationCable::Channel +# # current_user: current_user, +# # Make sure the channel is in the context +# channel: self, +# } +# +# result = MySchema.execute( +# query, +# context: context, +# variables: variables, +# operation_name: operation_name +# ) +# +# payload = { +# result: result.to_h, +# more: result.subscription?, +# } +# +# # Track the subscription here so we can remove it +# # on unsubscribe. +# if result.context[:subscription_id] +# @subscription_ids << result.context[:subscription_id] +# end +# +# transmit(payload) +# end +# +# def unsubscribed +# @subscription_ids.each { |sid| +# MySchema.subscriptions.delete_subscription(sid) +# } +# end +# +# private +# +# def ensure_hash(ambiguous_param) +# case ambiguous_param +# when String +# if ambiguous_param.present? +# ensure_hash(JSON.parse(ambiguous_param)) +# else +# {} +# end +# when Hash, ActionController::Parameters +# ambiguous_param +# when nil +# {} +# else +# raise ArgumentError, "Unexpected parameter: #{ambiguous_param}" +# end +# end +# end +# +# @see GraphQL::Testing::MockActionCable for test helpers +# +# pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:85 +class GraphQL::Subscriptions::ActionCableSubscriptions < ::GraphQL::Subscriptions + # @param serializer [<#dump(obj), #load(string)] Used for serializing messages before handing them to `.broadcast(msg)` + # @param namespace [string] Used to namespace events and subscriptions (default: '') + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:91 + def initialize(serializer: T.unsafe(nil), namespace: T.unsafe(nil), action_cable: T.unsafe(nil), action_cable_coder: T.unsafe(nil), **rest); end + + # The channel was closed, forget about it. + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:226 + def delete_subscription(subscription_id); end + + # This subscription was re-evaluated. + # Send it to the specific stream where this client was waiting. + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:127 + def deliver(subscription_id, result); end + + # An event was triggered; Push the data over ActionCable. + # Subscribers will re-evaluate locally. + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:119 + def execute_all(event, object); end + + # This is called to turn an ActionCable-broadcasted string (JSON) + # into a query-ready application object. + # @param message [String] n ActionCable-broadcasted string (JSON) + # @param context [GraphQL::Query::Context] the context of the first event for a given subscription fingerprint + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:199 + def load_action_cable_message(message, context); end + + # Return the query from "storage" (in memory) + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:208 + def read_subscription(subscription_id); end + + # Every subscribing channel is listening here, but only one of them takes any action. + # This is so we can reuse payloads when possible, and make one payload to send to + # all subscribers. + # + # But the problem is, any channel could close at any time, so each channel has to + # be ready to take over the primary position. + # + # To make sure there's always one-and-only-one channel building payloads, + # let the listener belonging to the first event on the list be + # the one to build and publish payloads. + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:168 + def setup_stream(channel, initial_event); end + + # A query was run where these events were subscribed to. + # Store them in memory in _this_ ActionCable frontend. + # It will receive notifications when events come in + # and re-evaluate the query locally. + # + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:137 + def write_subscription(query, events); end + + private + + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:251 + def stream_event_name(event); end + + # pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:247 + def stream_subscription_name(subscription_id); end +end + +# pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:87 +GraphQL::Subscriptions::ActionCableSubscriptions::EVENT_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/subscriptions/action_cable_subscriptions.rb:86 +GraphQL::Subscriptions::ActionCableSubscriptions::SUBSCRIPTION_PREFIX = T.let(T.unsafe(nil), String) + +# Detect whether the current operation: +# - Is a subscription operation +# - Is completely broadcastable +# +# Assign the result to `context.namespace(:subscriptions)[:subscription_broadcastable]` +# @api private +# @see Subscriptions#broadcastable? for a public API +# +# pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:12 +class GraphQL::Subscriptions::BroadcastAnalyzer < ::GraphQL::Analysis::Analyzer + # pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:13 + def initialize(subject); end + + # Only analyze subscription operations + # + # pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:21 + def analyze?; end + + # pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:25 + def on_enter_field(node, parent, visitor); end + + # Assign the result to context. + # (This method is allowed to return an error, but we don't need to) + # @return [void] + # + # pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:49 + def result; end + + private + + # Modify `@subscription_broadcastable` based on `field_defn`'s configuration (and/or the default value) + # + # pkg:gem/graphql#lib/graphql/subscriptions/broadcast_analyzer.rb:57 + def apply_broadcastable(owner_type, field_defn); end +end + +# pkg:gem/graphql#lib/graphql/subscriptions/default_subscription_resolve_extension.rb:4 +class GraphQL::Subscriptions::DefaultSubscriptionResolveExtension < ::GraphQL::Schema::FieldExtension + # pkg:gem/graphql#lib/graphql/subscriptions/default_subscription_resolve_extension.rb:34 + def after_resolve(context:, arguments:, values: T.unsafe(nil), value: T.unsafe(nil), objects: T.unsafe(nil), object: T.unsafe(nil), **rest); end + + # pkg:gem/graphql#lib/graphql/subscriptions/default_subscription_resolve_extension.rb:5 + def resolve(context:, arguments:, object: T.unsafe(nil), objects: T.unsafe(nil)); end + + class << self + # pkg:gem/graphql#lib/graphql/subscriptions/default_subscription_resolve_extension.rb:44 + def write_subscription(field, value, arguments, context); end + end +end + +# This thing can be: +# - Subscribed to by `subscription { ... }` +# - Triggered by `MySchema.subscriber.trigger(name, arguments, obj)` +# +# pkg:gem/graphql#lib/graphql/subscriptions/event.rb:8 +class GraphQL::Subscriptions::Event + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:21 + def initialize(name:, arguments:, field: T.unsafe(nil), context: T.unsafe(nil), scope: T.unsafe(nil)); end + + # @return [GraphQL::Execution::Interpreter::Arguments] + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:13 + def arguments; end + + # @return [GraphQL::Query::Context] + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:16 + def context; end + + # @return [String] a logical identifier for this event. (Stable when the query is broadcastable.) + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:48 + def fingerprint; end + + # @return [String] Corresponds to the Subscription root field name + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:10 + def name; end + + # @return [String] An opaque string which identifies this event, derived from `name` and `arguments` + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:19 + def topic; end + + class << self + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:64 + def arguments_without_field_extras(arguments:, field:); end + + # @return [String] an identifier for this unit of subscription + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:40 + def serialize(_name, arguments, field, scope:, context: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:92 + def deep_sort_array_hashes(array_to_inspect); end + + # This method does not support cyclic references in the Hash, + # nor does it support Hashes whose keys are not sortable + # with respect to their peers ( cases where a <=> b might throw an error ) + # + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:79 + def deep_sort_hash_keys(hash_to_sort); end + + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:150 + def get_arg_definition(arg_owner, arg_name, context); end + + # pkg:gem/graphql#lib/graphql/subscriptions/event.rb:105 + def stringify_args(arg_owner, args, context); end + end +end + +# pkg:gem/graphql#lib/graphql/subscriptions.rb:266 +class GraphQL::Subscriptions::Finalizer + include ::GraphQL::Execution::Finalizer + + # pkg:gem/graphql#lib/graphql/subscriptions.rb:268 + def initialize(subscriptions); end + + # pkg:gem/graphql#lib/graphql/subscriptions.rb:272 + def finalize_graphql_result(query, result_data, result_key); end +end + +# Raised when either: +# - the triggered `event_name` doesn't match a field in the schema; or +# - one or more arguments don't match the field arguments +# +# pkg:gem/graphql#lib/graphql/subscriptions.rb:14 +class GraphQL::Subscriptions::InvalidTriggerError < ::GraphQL::Error; end + +# Serialization helpers for passing subscription data around. +# @api private +# +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:7 +module GraphQL::Subscriptions::Serialize + private + + # @param obj [Object] Some subscription-related data to dump + # @return [String] The stringified object + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:26 + def dump(obj); end + + # This is for turning objects into subscription scopes. + # It's a one-way transformation, can't reload this :'( + # @param obj [Object] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:34 + def dump_recursive(obj); end + + # @param str [String] A serialized object from {.dump} + # @return [Object] An object equivalent to the one passed to {.dump} + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:19 + def load(str); end + + class << self + # @param obj [Object] Some subscription-related data to dump + # @return [String] The stringified object + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:26 + def dump(obj); end + + # This is for turning objects into subscription scopes. + # It's a one-way transformation, can't reload this :'( + # @param obj [Object] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:34 + def dump_recursive(obj); end + + # @param str [String] A serialized object from {.dump} + # @return [Object] An object equivalent to the one passed to {.dump} + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:19 + def load(str); end + + private + + # @param obj [Object] Some subscription-related data to dump + # @return [Object] The object that converted Global::Identification + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:113 + def dump_value(obj); end + + # @param value [Object] A parsed JSON object + # @return [Object] An object that load Global::Identification recursive + # + # pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:56 + def load_value(value); end + end +end + +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:8 +GraphQL::Subscriptions::Serialize::GLOBALID_KEY = T.let(T.unsafe(nil), String) + +# eg '2020-01-01 23:59:59.123456789+05:00' +# +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:13 +GraphQL::Subscriptions::Serialize::OPEN_STRUCT_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:9 +GraphQL::Subscriptions::Serialize::SYMBOL_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:10 +GraphQL::Subscriptions::Serialize::SYMBOL_KEYS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:12 +GraphQL::Subscriptions::Serialize::TIMESTAMP_FORMAT = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/subscriptions/serialize.rb:11 +GraphQL::Subscriptions::Serialize::TIMESTAMP_KEY = T.let(T.unsafe(nil), String) + +# Raised when either: +# - An initial subscription didn't have a value for `context[subscription_scope]` +# - Or, an update didn't pass `.trigger(..., scope:)` +# When raised, the initial subscription or update fails completely. +# +# pkg:gem/graphql#lib/graphql/subscriptions.rb:21 +class GraphQL::Subscriptions::SubscriptionScopeMissingError < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:3 +module GraphQL::Testing; end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:4 +module GraphQL::Testing::Helpers + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:42 + def run_graphql_field(schema, field_path, object, arguments: T.unsafe(nil), context: T.unsafe(nil), ast_node: T.unsafe(nil), lookahead: T.unsafe(nil), visibility_profile: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:107 + def with_resolution_context(schema, type:, object:, context: T.unsafe(nil), visibility_profile: T.unsafe(nil)); end + + class << self + # @param schema_class [Class] + # @return [Module] A helpers module which always uses the given schema + # + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:7 + def for(schema_class); end + end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:11 +class GraphQL::Testing::Helpers::Error < ::GraphQL::Error; end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:35 +class GraphQL::Testing::Helpers::FieldNotDefinedError < ::GraphQL::Testing::Helpers::Error + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:36 + def initialize(type_name:, field_name:); end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:21 +class GraphQL::Testing::Helpers::FieldNotVisibleError < ::GraphQL::Testing::Helpers::Error + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:22 + def initialize(type_name:, field_name:); end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:119 +class GraphQL::Testing::Helpers::ResolutionAssertionContext + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:120 + def initialize(test, type_name:, object:, schema:, context:, visibility_profile:); end + + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:131 + def run_graphql_field(field_name, arguments: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:129 + def visibility_profile; end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:140 +module GraphQL::Testing::Helpers::SchemaHelpers + include ::GraphQL::Testing::Helpers + + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:143 + def run_graphql_field(field_path, object, arguments: T.unsafe(nil), context: T.unsafe(nil), visibility_profile: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:147 + def with_resolution_context(*args, **kwargs, &block); end + + class << self + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:152 + def for(schema_class); end + end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:28 +class GraphQL::Testing::Helpers::TypeNotDefinedError < ::GraphQL::Testing::Helpers::Error + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:29 + def initialize(type_name:); end +end + +# pkg:gem/graphql#lib/graphql/testing/helpers.rb:14 +class GraphQL::Testing::Helpers::TypeNotVisibleError < ::GraphQL::Testing::Helpers::Error + # pkg:gem/graphql#lib/graphql/testing/helpers.rb:15 + def initialize(type_name:); end +end + +# A stub implementation of ActionCable. +# Any methods to support the mock backend have `mock` in the name. +# +# @example Configuring your schema to use MockActionCable in the test environment +# class MySchema < GraphQL::Schema +# # Use MockActionCable in test: +# use GraphQL::Subscriptions::ActionCableSubscriptions, +# action_cable: Rails.env.test? ? GraphQL::Testing::MockActionCable : ActionCable +# end +# +# @example Clearing old data before each test +# setup do +# GraphQL::Testing::MockActionCable.clear_mocks +# end +# +# @example Using MockActionCable in a test case +# # Create a channel to use in the test, pass it to GraphQL +# mock_channel = GraphQL::Testing::MockActionCable.get_mock_channel +# ActionCableTestSchema.execute("subscription { newsFlash { text } }", context: { channel: mock_channel }) +# +# # Trigger a subscription update +# ActionCableTestSchema.subscriptions.trigger(:news_flash, {}, {text: "After yesterday's rain, someone stopped on Rio Road to help a box turtle across five lanes of traffic"}) +# +# # Check messages on the channel +# expected_msg = { +# result: { +# "data" => { +# "newsFlash" => { +# "text" => "After yesterday's rain, someone stopped on Rio Road to help a box turtle across five lanes of traffic" +# } +# } +# }, +# more: true, +# } +# assert_equal [expected_msg], mock_channel.mock_broadcasted_messages +# +# pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:40 +class GraphQL::Testing::MockActionCable + class << self + # Implements Rails API + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:87 + def broadcast(stream_name, message); end + + # Call this before each test run to make sure that MockActionCable's data is empty + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:77 + def clear_mocks; end + + # Use this as `context[:channel]` to simulate an ActionCable channel + # + # @return [GraphQL::Testing::MockActionCable::MockChannel] + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:100 + def get_mock_channel; end + + # Used by mock code + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:93 + def mock_stream_for(stream_name); end + + # @return [Array] Streams that currently have subscribers + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:105 + def mock_stream_names; end + + # Implements Rails API + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:82 + def server; end + end +end + +# pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:41 +class GraphQL::Testing::MockActionCable::MockChannel + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:42 + def initialize; end + + # @return [Array] Payloads "sent" to this channel by GraphQL-Ruby + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:47 + def mock_broadcasted_messages; end + + # Called by ActionCableSubscriptions. Implements a Rails API. + # + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:50 + def stream_from(stream_name, coder: T.unsafe(nil), &block); end +end + +# Used by mock code +# @api private +# +# pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:59 +class GraphQL::Testing::MockActionCable::MockStream + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:60 + def initialize; end + + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:64 + def add_mock_channel(channel, handler); end + + # pkg:gem/graphql#lib/graphql/testing/mock_action_cable.rb:68 + def mock_broadcast(message); end +end + +# pkg:gem/graphql#lib/graphql/tracing.rb:5 +module GraphQL::Tracing; end + +# This implementation forwards events to ActiveSupport::Notifications with a `graphql` suffix. +# +# @example Sending execution events to ActiveSupport::Notifications +# class MySchema < GraphQL::Schema +# trace_with(GraphQL::Tracing::ActiveSupportNotificationsTrace) +# end +# +# @example Subscribing to GraphQL events with ActiveSupport::Notifications +# ActiveSupport::Notifications.subscribe(/graphql/) do |event| +# pp event.name +# pp event.payload +# end +# +# pkg:gem/graphql#lib/graphql/tracing/active_support_notifications_trace.rb:20 +module GraphQL::Tracing::ActiveSupportNotificationsTrace + include ::GraphQL::Tracing::NotificationsTrace + + # pkg:gem/graphql#lib/graphql/tracing/active_support_notifications_trace.rb:22 + def initialize(engine: T.unsafe(nil), **rest); end +end + +# This implementation forwards events to ActiveSupport::Notifications +# with a `graphql` suffix. +# +# @see KEYS for event names +# +# pkg:gem/graphql#lib/graphql/tracing/active_support_notifications_tracing.rb:11 +module GraphQL::Tracing::ActiveSupportNotificationsTracing + class << self + # pkg:gem/graphql#lib/graphql/tracing/active_support_notifications_tracing.rb:16 + def trace(key, metadata, &blk); end + end +end + +# A cache of frequently-used keys to avoid needless string allocations +# +# pkg:gem/graphql#lib/graphql/tracing/active_support_notifications_tracing.rb:13 +GraphQL::Tracing::ActiveSupportNotificationsTracing::KEYS = T.let(T.unsafe(nil), Hash) + +# This class uses the AppopticsAPM SDK from the appoptics_apm gem to create +# traces for GraphQL. +# +# There are 4 configurations available. They can be set in the +# appoptics_apm config file or in code. Please see: +# {https://docs.appoptics.com/kb/apm_tracing/ruby/configure} +# +# AppOpticsAPM::Config[:graphql][:enabled] = true|false +# AppOpticsAPM::Config[:graphql][:transaction_name] = true|false +# AppOpticsAPM::Config[:graphql][:sanitize_query] = true|false +# AppOpticsAPM::Config[:graphql][:remove_comments] = true|false +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:19 +module GraphQL::Tracing::AppOpticsTrace + include ::GraphQL::Tracing::PlatformTrace + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def analyze_multiplex(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def analyze_query(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:96 + def authorized(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:107 + def authorized_lazy(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:66 + def execute_field(query:, field:, ast_node:, arguments:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:92 + def execute_field_lazy(query:, field:, ast_node:, arguments:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def execute_multiplex(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def execute_query(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def execute_query_lazy(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def lex(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def parse(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:147 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:143 + def platform_field_key(field); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:151 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:118 + def resolve_type(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:130 + def resolve_type_lazy(**data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:47 + def validate(**data); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:157 + def gql_config; end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:210 + def graphql_context(context, layer); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:236 + def graphql_multiplex(data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:218 + def graphql_query(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:229 + def graphql_query_string(query_string); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:190 + def metadata(data, layer); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:172 + def multiplex_transaction_name(names); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:252 + def remove_comments(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:243 + def sanitize(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:182 + def span_name(key); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:161 + def transaction_name(query); end + + class << self + # pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:31 + def version; end + end +end + +# These GraphQL events will show up as 'graphql.execute' spans +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:23 +GraphQL::Tracing::AppOpticsTrace::EXEC_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:141 +class GraphQL::Tracing::AppOpticsTrace::KeyCache + include ::GraphQL::Tracing::PlatformTrace + include ::GraphQL::Tracing::AppOpticsTrace + include ::GraphQL::Tracing::PlatformTrace::BaseKeyCache +end + +# These GraphQL events will show up as 'graphql.prep' spans +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_trace.rb:21 +GraphQL::Tracing::AppOpticsTrace::PREP_KEYS = T.let(T.unsafe(nil), Array) + +# This class uses the AppopticsAPM SDK from the appoptics_apm gem to create +# traces for GraphQL. +# +# There are 4 configurations available. They can be set in the +# appoptics_apm config file or in code. Please see: +# {https://docs.appoptics.com/kb/apm_tracing/ruby/configure} +# +# AppOpticsAPM::Config[:graphql][:enabled] = true|false +# AppOpticsAPM::Config[:graphql][:transaction_name] = true|false +# AppOpticsAPM::Config[:graphql][:sanitize_query] = true|false +# AppOpticsAPM::Config[:graphql][:remove_comments] = true|false +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:19 +class GraphQL::Tracing::AppOpticsTracing < ::GraphQL::Tracing::PlatformTracing + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:25 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:68 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:64 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:72 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:49 + def platform_trace(platform_key, _key, data); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:78 + def gql_config; end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:131 + def graphql_context(context, layer); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:157 + def graphql_multiplex(data); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:139 + def graphql_query(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:150 + def graphql_query_string(query_string); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:111 + def metadata(data, layer); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:93 + def multiplex_transaction_name(names); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:173 + def remove_comments(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:164 + def sanitize(query); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:103 + def span_name(key); end + + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:82 + def transaction_name(query); end + + class << self + # During auto-instrumentation this version of AppOpticsTracing is compared + # with the version provided in the appoptics_apm gem, so that the newer + # version of the class can be used + # + # pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:34 + def version; end + end +end + +# These GraphQL events will show up as 'graphql.execute' spans +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:23 +GraphQL::Tracing::AppOpticsTracing::EXEC_KEYS = T.let(T.unsafe(nil), Array) + +# These GraphQL events will show up as 'graphql.prep' spans +# +# pkg:gem/graphql#lib/graphql/tracing/appoptics_tracing.rb:21 +GraphQL::Tracing::AppOpticsTracing::PREP_KEYS = T.let(T.unsafe(nil), Array) + +# Instrumentation for reporting GraphQL-Ruby times to Appsignal. +# +# @example Installing the tracer +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::AppsignalTrace +# end +# +# pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 +module GraphQL::Tracing::AppsignalTrace + # @param set_action_name [Boolean] If true, the GraphQL operation name will be used as the transaction name. + # This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing. + # It can also be specified per-query with `context[:set_appsignal_action_name]`. + # + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def initialize(set_action_name: T.unsafe(nil), **rest); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def setup_appsignal_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def begin_appsignal_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:12 + def finish_appsignal_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:23 +class GraphQL::Tracing::AppsignalTrace::AppsignalMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:24 + def instrument(keyword, object); end +end + +# pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:38 +class GraphQL::Tracing::AppsignalTrace::AppsignalMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:43 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_trace.rb:39 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::AppsignalTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::AppsignalTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:7 +class GraphQL::Tracing::AppsignalTracing < ::GraphQL::Tracing::PlatformTracing + # @param set_action_name [Boolean] If true, the GraphQL operation name will be used as the transaction name. + # This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing. + # It can also be specified per-query with `context[:set_appsignal_action_name]`. + # + # pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:22 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:44 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:40 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:48 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/appsignal_tracing.rb:27 + def platform_trace(platform_key, key, data); end +end + +# This trace class calls legacy-style tracer with payload hashes. +# New-style `trace_with` modules significantly reduce the overhead of tracing, +# but that advantage is lost when legacy-style tracers are also used (since the payload hashes are still constructed). +# +# pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:8 +module GraphQL::Tracing::CallLegacyTracers + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:21 + def analyze_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:25 + def analyze_query(query:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:49 + def authorized(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:53 + def authorized_lazy(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:41 + def execute_field(field:, query:, ast_node:, arguments:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:45 + def execute_field_lazy(field:, query:, ast_node:, arguments:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:29 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:33 + def execute_query(query:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:37 + def execute_query_lazy(query:, multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:9 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:13 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:57 + def resolve_type(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:61 + def resolve_type_lazy(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/call_legacy_tracers.rb:17 + def validate(query:, validate:); end +end + +# A tracer for reporting to DataDog +# @example Adding this tracer to your schema +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::DataDogTrace +# end +# @example Skipping `resolve_type` and `authorized` events +# trace_with GraphQL::Tracing::DataDogTrace, trace_authorized: false, trace_resolve_type: false +# +# pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 +module GraphQL::Tracing::DataDogTrace + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def setup_datadog_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def begin_datadog_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:13 + def finish_datadog_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::DataDogTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:15 +class GraphQL::Tracing::DataDogTrace::DatadogMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:16 + def initialize(set_transaction_name:, service: T.unsafe(nil), tracer: T.unsafe(nil), **_rest); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:28 + def instrument(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:26 + def service_name; end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:26 + def tracer; end +end + +# pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:58 +class GraphQL::Tracing::DataDogTrace::DatadogMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:64 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_trace.rb:59 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::DataDogTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:7 +class GraphQL::Tracing::DataDogTracing < ::GraphQL::Tracing::PlatformTracing + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:65 + def analytics_enabled?; end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:70 + def analytics_sample_rate; end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:79 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:75 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:83 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:19 + def platform_trace(platform_key, key, data); end + + # Implement this method in a subclass to apply custom tags to datadog spans + # @param key [String] The event being traced + # @param data [Hash] The runtime data for this event (@see GraphQL::Tracing for keys for each event) + # @param span [Datadog::Tracing::SpanOperation] The datadog span for this event + # + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:55 + def prepare_span(key, data, span); end + + # pkg:gem/graphql#lib/graphql/tracing/data_dog_tracing.rb:58 + def tracer; end +end + +# `DetailedTrace` can make detailed profiles for a subset of production traffic. Install it in Rails with `rails generate graphql:detailed_trace`. +# +# When `MySchema.detailed_trace?(query)` returns `true`, a profiler-specific `trace_mode: ...` will be used for the query, +# overriding the one in `context[:trace_mode]`. +# +# By default, the detailed tracer calls `.inspect` on application objects returned from fields. You can customize +# this behavior by extending {DetailedTrace} and overriding {#inspect_object}. You can opt out of debug annotations +# entirely with `use ..., debug: false` or for a single query with `context: { detailed_trace_debug: false }`. +# +# You can store saved traces in two ways: +# +# - __ActiveRecord__: With `rails generate graphql:detailed_trace`, a new migration will be added to your app. +# That table will be used to store trace data. +# +# - __Redis__: Pass `redis: ...` to save trace data to a Redis database. Depending on your needs, +# you can configure this database to retain all data (persistent) or to expire data according to your rules. +# +# If you need to save traces indefinitely, you can download them from Perfetto after opening them there. +# +# @example Installing with Rails +# rails generate graphql:detailed_trace # optional: --redis +# +# @example Adding the sampler to your schema +# class MySchema < GraphQL::Schema +# # Add the sampler: +# use GraphQL::Tracing::DetailedTrace, redis: Redis.new(...), limit: 100 +# +# # And implement this hook to tell it when to take a sample: +# def self.detailed_trace?(query) +# # Could use `query.context`, `query.selected_operation_name`, `query.query_string` here +# # Could call out to Flipper, etc +# rand <= 0.000_1 # one in ten thousand +# end +# end +# +# @see Graphql::Dashboard GraphQL::Dashboard for viewing stored results +# +# @example Customizing debug output in traces +# class CustomDetailedTrace < GraphQL::Tracing::DetailedTrace +# def inspect_object(object) +# if object.is_a?(SomeThing) +# # handle it specially ... +# else +# super +# end +# end +# end +# +# @example disabling debug annotations completely +# use DetailedTrace, debug: false, ... +# +# @example disabling debug annotations for one query +# MySchema.execute(query_str, context: { detailed_trace_debug: false }) +# +# pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:5 +class GraphQL::Tracing::DetailedTrace + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:84 + def initialize(storage:, trace_mode:, debug:); end + + # @return [Boolean] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:99 + def debug?; end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:121 + def delete_all_traces; end + + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:116 + def delete_trace(id); end + + # @return [StoredTrace, nil] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:111 + def find_trace(id); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:125 + def inspect_object(object); end + + # @return [String] ID of saved trace + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:94 + def save_trace(operation_name, duration_ms, begin_ms, trace_data); end + + # @return [Symbol] The trace mode to use when {Schema.detailed_trace?} returns `true` + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:91 + def trace_mode; end + + # @param last [Integer] + # @param before [Integer] Timestamp in milliseconds since epoch + # @return [Enumerable] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:106 + def traces(last: T.unsafe(nil), before: T.unsafe(nil)); end + + class << self + # Default debug setting + # @return [true] + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:139 + def debug?; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:129 + def inspect_object(object); end + + # @param redis [Redis] If provided, profiles will be stored in Redis for later review + # @param limit [Integer] A maximum number of profiles to store + # @param debug [Boolean] if `false`, it won't create `debug` annotations in Perfetto traces (reduces overhead) + # @param model_class [Class] Overrides {ActiveRecordBackend::GraphqlDetailedTrace} if present + # + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:69 + def use(schema, trace_mode: T.unsafe(nil), memory: T.unsafe(nil), debug: T.unsafe(nil), redis: T.unsafe(nil), limit: T.unsafe(nil), model_class: T.unsafe(nil)); end + end +end + +# An in-memory trace storage backend. Suitable for testing and development only. +# It won't work for multi-process deployments and everything is erased when the app is restarted. +# +# pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:8 +class GraphQL::Tracing::DetailedTrace::MemoryBackend + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:9 + def initialize(limit: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:36 + def delete_all_traces; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:31 + def delete_trace(id); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:27 + def find_trace(id); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:41 + def save_trace(operation_name, duration, begin_ms, trace_data); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/memory_backend.rb:15 + def traces(last:, before:); end +end + +# pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:6 +class GraphQL::Tracing::DetailedTrace::RedisBackend + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:8 + def initialize(redis:, limit: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:32 + def delete_all_traces; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:27 + def delete_trace(id); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:36 + def find_trace(id); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:45 + def save_trace(operation_name, duration_ms, begin_ms, trace_data); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:14 + def traces(last:, before:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:59 + def entry_to_trace(id, json_str); end +end + +# pkg:gem/graphql#lib/graphql/tracing/detailed_trace/redis_backend.rb:7 +GraphQL::Tracing::DetailedTrace::RedisBackend::KEY_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:143 +class GraphQL::Tracing::DetailedTrace::StoredTrace + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:144 + def initialize(id:, operation_name:, duration_ms:, begin_ms:, trace_data:); end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:152 + def begin_ms; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:152 + def duration_ms; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:152 + def id; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:152 + def operation_name; end + + # pkg:gem/graphql#lib/graphql/tracing/detailed_trace.rb:152 + def trace_data; end +end + +# pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:5 +module GraphQL::Tracing::LegacyHooksTrace + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:6 + def execute_multiplex(multiplex:); end +end + +# pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:17 +module GraphQL::Tracing::LegacyHooksTrace::RunHooks + private + + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:62 + def call_after_hooks(instrumenters, object, after_hook_name, ex); end + + # Call each before hook, and if they all succeed, yield. + # If they don't all succeed, call after_ for each one that succeeded. + # + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:37 + def call_hooks(instrumenters, object, before_hook_name, after_hook_name); end + + # Call the before_ hooks of each query, + # Then yield if no errors. + # `call_hooks` takes care of appropriate cleanup. + # + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:22 + def each_query_call_hooks(instrumenters, queries, i = T.unsafe(nil)); end + + class << self + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:62 + def call_after_hooks(instrumenters, object, after_hook_name, ex); end + + # Call each before hook, and if they all succeed, yield. + # If they don't all succeed, call after_ for each one that succeeded. + # + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:37 + def call_hooks(instrumenters, object, before_hook_name, after_hook_name); end + + # Call the before_ hooks of each query, + # Then yield if no errors. + # `call_hooks` takes care of appropriate cleanup. + # + # pkg:gem/graphql#lib/graphql/tracing/legacy_hooks_trace.rb:22 + def each_query_call_hooks(instrumenters, queries, i = T.unsafe(nil)); end + end +end + +# pkg:gem/graphql#lib/graphql/tracing/legacy_trace.rb:8 +class GraphQL::Tracing::LegacyTrace < ::GraphQL::Tracing::Trace + include ::GraphQL::Tracing::CallLegacyTracers +end + +# This module is the basis for Ruby-level integration with third-party monitoring platforms. +# Platform-specific traces include this module and implement an adapter. +# +# @see ActiveSupportNotificationsTrace Integration via ActiveSupport::Notifications, an alternative approach. +# +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:9 +module GraphQL::Tracing::MonitorTrace + class << self + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:135 + def create_module(monitor_name); end + end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:149 +GraphQL::Tracing::MonitorTrace::MODULE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:10 +class GraphQL::Tracing::MonitorTrace::Monitor + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:11 + def initialize(trace:, set_transaction_name:, **_rest); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:44 + def fallback_transaction_name(context); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:20 + def instrument(keyword, object, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:48 + def name_for(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:24 + def start_event(keyword, object); end + + # Get the transaction name based on the operation type and name if possible, or fall back to a user provided + # one. Useful for anonymous queries. + # + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:32 + def transaction_name(query); end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:68 +class GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:69 + def initialize(monitor, keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:81 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:75 + def keyword; end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:75 + def object; end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:77 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:110 +module GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:121 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:117 + def platform_field_key(field); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:125 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:129 + def platform_source_class_key(source_class); end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:115 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames::ANALYZE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:114 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames::EXECUTE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:112 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames::LEX_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:111 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames::PARSE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:113 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames::VALIDATE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:86 +module GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:97 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:93 + def platform_field_key(field); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:101 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:105 + def platform_source_class_key(source_class); end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:91 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames::ANALYZE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:90 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames::EXECUTE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:88 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames::LEX_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:87 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames::PARSE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:89 +GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames::VALIDATE_NAME = T.let(T.unsafe(nil), String) + +# A tracer for reporting GraphQL-Ruby time to New Relic +# +# @example Installing the tracer +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::NewRelicTrace +# +# # Optional, use the operation name to set the new relic transaction name: +# # trace_with GraphQL::Tracing::NewRelicTrace, set_transaction_name: true +# end +# +# @example Installing without trace events for `authorized?` or `resolve_type` calls +# trace_with GraphQL::Tracing::NewRelicTrace, trace_authorized: false, trace_resolve_type: false +# +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 +module GraphQL::Tracing::NewRelicTrace + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def setup_newrelic_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def begin_newrelic_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:19 + def finish_newrelic_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::NewRelicTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:21 +class GraphQL::Tracing::NewRelicTrace::NewrelicMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:28 + def instrument(keyword, payload, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:47 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:43 + def platform_field_key(field); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:51 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:39 + def platform_source_class_key(source_class); end +end + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:26 +GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::ANALYZE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:25 +GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::EXECUTE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:55 +class GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:61 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:56 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:23 +GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::LEX_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:22 +GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::PARSE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_trace.rb:24 +GraphQL::Tracing::NewRelicTrace::NewrelicMonitor::VALIDATE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::NewRelicTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:7 +class GraphQL::Tracing::NewRelicTracing < ::GraphQL::Tracing::PlatformTracing + # @param set_transaction_name [Boolean] If true, the GraphQL operation name will be used as the transaction name. + # This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing. + # It can also be specified per-query with `context[:set_new_relic_transaction_name]`. + # + # pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:22 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:44 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:40 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:48 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/new_relic_tracing.rb:27 + def platform_trace(platform_key, key, data); end +end + +# This implementation forwards events to a notification handler +# (i.e. ActiveSupport::Notifications or Dry::Monitor::Notifications) with a `graphql` suffix. +# +# @see ActiveSupportNotificationsTrace ActiveSupport::Notifications integration +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:9 +module GraphQL::Tracing::NotificationsTrace + # @param engine [Class] The notifications engine to use, eg `Dry::Monitor` or `ActiveSupport::Notifications` + # + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:77 + def initialize(engine:, **rest); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:107 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:146 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:166 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:123 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:156 + def begin_resolve_type(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:138 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:133 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:112 + def end_analyze_multiplex(_multiplex, _analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:151 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:171 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:128 + def end_execute_field(_field, _object, _arguments, _query, _result); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:161 + def end_resolve_type(type, object, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:117 + def execute_multiplex(**payload); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:95 + def lex(**payload); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:89 + def parse(**payload); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:101 + def validate(**payload); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:181 + def begin_notifications_event(name, payload); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:185 + def finish_notifications_event; end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:58 +class GraphQL::Tracing::NotificationsTrace::ActiveSupportNotificationsAdapter < ::GraphQL::Tracing::NotificationsTrace::Adapter + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:59 + def instrument(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:63 +class GraphQL::Tracing::NotificationsTrace::ActiveSupportNotificationsAdapter::Event < ::GraphQL::Tracing::NotificationsTrace::Adapter::Event + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:69 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:64 + def start; end +end + +# @api private +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:11 +class GraphQL::Tracing::NotificationsTrace::Adapter + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:12 + def instrument(keyword, payload, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:16 + def start_event(keyword, payload); end +end + +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:22 +class GraphQL::Tracing::NotificationsTrace::Adapter::Event + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:23 + def initialize(name, payload); end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:34 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:28 + def name; end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:28 + def payload; end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:30 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:176 +GraphQL::Tracing::NotificationsTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# @api private +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:41 +class GraphQL::Tracing::NotificationsTrace::DryMonitorAdapter < ::GraphQL::Tracing::NotificationsTrace::Adapter + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:42 + def instrument(*_arg0, **_arg1, &_arg2); end +end + +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:46 +class GraphQL::Tracing::NotificationsTrace::DryMonitorAdapter::Event < ::GraphQL::Tracing::NotificationsTrace::Adapter::Event + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:51 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:47 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/notifications_trace.rb:177 +GraphQL::Tracing::NotificationsTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# This implementation forwards events to a notification handler (i.e. +# ActiveSupport::Notifications or Dry::Monitor::Notifications) +# with a `graphql` suffix. +# +# @see KEYS for event names +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_tracing.rb:12 +class GraphQL::Tracing::NotificationsTracing + # Initialize a new NotificationsTracing instance + # + # @param [Object] notifications_engine The notifications engine to use + # + # pkg:gem/graphql#lib/graphql/tracing/notifications_tracing.rb:35 + def initialize(notifications_engine); end + + # Sends a GraphQL tracing event to the notification handler + # + # @example + # . notifications_engine = Dry::Monitor::Notifications.new(:graphql) + # . tracer = GraphQL::Tracing::NotificationsTracing.new(notifications_engine) + # . tracer.trace("lex") { ... } + # + # @param [string] key The key for the event + # @param [Hash] metadata The metadata for the event + # @yield The block to execute for the event + # + # pkg:gem/graphql#lib/graphql/tracing/notifications_tracing.rb:49 + def trace(key, metadata, &blk); end +end + +# A cache of frequently-used keys to avoid needless string allocations +# +# pkg:gem/graphql#lib/graphql/tracing/notifications_tracing.rb:14 +GraphQL::Tracing::NotificationsTracing::KEYS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/tracing/notifications_tracing.rb:30 +GraphQL::Tracing::NotificationsTracing::MAX_KEYS_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/null_trace.rb:7 +GraphQL::Tracing::NullTrace = T.let(T.unsafe(nil), GraphQL::Tracing::Trace) + +# pkg:gem/graphql#lib/graphql/tracing.rb:68 +module GraphQL::Tracing::NullTracer + private + + # pkg:gem/graphql#lib/graphql/tracing.rb:70 + def trace(k, v); end + + class << self + # pkg:gem/graphql#lib/graphql/tracing.rb:70 + def trace(k, v); end + end +end + +# This produces a trace file for inspecting in the [Perfetto Trace Viewer](https://ui.perfetto.dev). +# +# To get the file, call {#write} on the trace. +# +# Use "trace modes" to configure this to run on command or on a sample of traffic. +# +# @example Writing trace output +# +# result = MySchema.execute(...) +# result.query.trace.write(file: "tmp/trace.dump") +# +# @example Running this instrumenter when `trace: true` is present in the request +# +# class MySchema < GraphQL::Schema +# # Only run this tracer when `context[:trace_mode]` is `:trace` +# trace_with GraphQL::Tracing::Perfetto, mode: :trace +# end +# +# # In graphql_controller.rb: +# +# context[:trace_mode] = params[:trace] ? :trace : nil +# result = MySchema.execute(query_str, context: context, variables: variables, ...) +# if context[:trace_mode] == :trace +# result.trace.write(file: ...) +# end +# +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:30 +module GraphQL::Tracing::PerfettoTrace + # @param active_support_notifications_pattern [String, RegExp, false] A filter for `ActiveSupport::Notifications`, if it's present. Or `false` to skip subscribing. + # + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:78 + def initialize(active_support_notifications_pattern: T.unsafe(nil), save_profile: T.unsafe(nil), **_rest); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:291 + def begin_analyze_multiplex(m, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:513 + def begin_authorized(type, obj, ctx); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:455 + def begin_dataloader(dl); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:475 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:254 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:543 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:338 + def begin_validate(query, validate); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:443 + def dataloader_fiber_exit; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:424 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:402 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:376 + def dataloader_spawn_execution_fiber(jobs); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:389 + def dataloader_spawn_source_fiber(pending_sources); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:306 + def end_analyze_multiplex(m, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:527 + def end_authorized(type, obj, ctx, is_authorized); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:466 + def end_dataloader(dl); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:500 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:268 + def end_execute_field(field, object, arguments, query, app_result); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:557 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:352 + def end_validate(query, validate, validation_errors); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:224 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:318 + def parse(query_string:); end + + # Dump protobuf output in the specified file. + # @param file [String] path to a file in a directory that already exists + # @param debug_json [Boolean] True to print JSON instead of binary + # @return [nil, String, Hash] If `file` was given, `nil`. If `file` was `nil`, a Hash if `debug_json: true`, else binary data. + # + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:577 + def write(file:, debug_json: T.unsafe(nil)); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:727 + def count_allocations; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:731 + def count_fibers(diff); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:735 + def count_fields; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:626 + def debug_annotation(iid, value_key, value); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:739 + def dup_with(message, attrs, delete_counters: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:749 + def fiber_flow_stack; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:606 + def fid; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:767 + def new_interned_data; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:634 + def payload_to_debug(k, v, iid: T.unsafe(nil), intern_value: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:823 + def subscribe_to_active_support_notifications(pattern); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:602 + def tid; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:753 + def trace_packet(timestamp: T.unsafe(nil), **event_attrs); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:794 + def track_descriptor_packet(parent_uuid, uuid, name, counter: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:598 + def ts; end + + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:817 + def unsubscribe_from_active_support_notifications; end + + class << self + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:45 + def included(_trace_class); end + end +end + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:53 +GraphQL::Tracing::PerfettoTrace::ACTIVE_SUPPORT_NOTIFICATIONS_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:70 +GraphQL::Tracing::PerfettoTrace::ANON_CLASS_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:54 +GraphQL::Tracing::PerfettoTrace::AUTHORIZED_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:610 +class GraphQL::Tracing::PerfettoTrace::ArgumentsFilter + # pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:616 + def filter_param(key, value); end +end + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:614 +GraphQL::Tracing::PerfettoTrace::ArgumentsFilter::FILTERED = T.let(T.unsafe(nil), String) + +# From Rails defaults +# https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt#L6-L8 +# +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:613 +GraphQL::Tracing::PerfettoTrace::ArgumentsFilter::SENSITIVE_KEY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:51 +GraphQL::Tracing::PerfettoTrace::DATALOADER_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:59 +GraphQL::Tracing::PerfettoTrace::DA_ARGUMENTS_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:73 +GraphQL::Tracing::PerfettoTrace::DA_DEBUG_INSPECT_CLASS_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:75 +GraphQL::Tracing::PerfettoTrace::DA_DEBUG_INSPECT_FOR_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:60 +GraphQL::Tracing::PerfettoTrace::DA_FETCH_KEYS_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:57 +GraphQL::Tracing::PerfettoTrace::DA_OBJECT_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:58 +GraphQL::Tracing::PerfettoTrace::DA_RESULT_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:61 +GraphQL::Tracing::PerfettoTrace::DA_STR_VAL_NIL_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:72 +GraphQL::Tracing::PerfettoTrace::DEBUG_INSPECT_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:74 +GraphQL::Tracing::PerfettoTrace::DEBUG_INSPECT_EVENT_NAME_IID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:52 +GraphQL::Tracing::PerfettoTrace::FIELD_EXECUTE_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# TODOs: +# - Make debug annotations visible on both parts when dataloader is involved +# +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:34 +GraphQL::Tracing::PerfettoTrace::PROTOBUF_AVAILABLE = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:55 +GraphQL::Tracing::PerfettoTrace::RESOLVE_TYPE_CATEGORY_IIDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/graphql#lib/graphql/tracing/perfetto_trace.rb:63 +GraphQL::Tracing::PerfettoTrace::REVERSE_DEBUG_NAME_LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:5 +module GraphQL::Tracing::PlatformTrace + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:6 + def initialize(trace_scalars: T.unsafe(nil), **_options); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:28 + def platform_authorized_lazy(key, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:24 + def platform_execute_field_lazy(*args, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:32 + def platform_resolve_type_lazy(key, &block); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:118 + def fallback_transaction_name(context); end + + # Get the transaction name based on the operation type and name if possible, or fall back to a user provided + # one. Useful for anonymous queries. + # + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:106 + def transaction_name(query); end + + class << self + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:36 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:13 +module GraphQL::Tracing::PlatformTrace::BaseKeyCache + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:14 + def initialize; end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:20 + def platform_authorized_key_cache; end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:20 + def platform_field_key_cache; end + + # pkg:gem/graphql#lib/graphql/tracing/platform_trace.rb:20 + def platform_resolve_type_key_cache; end +end + +# Each platform provides: +# - `.platform_keys` +# - `#platform_trace` +# - `#platform_field_key(type, field)` +# @api private +# +# pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:10 +class GraphQL::Tracing::PlatformTracing + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:19 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:25 + def trace(key, data); end + + private + + # Different kind of schema objects have different kinds of keys: + # + # - Object types: `.authorized` + # - Union/Interface types: `.resolve_type` + # - Fields: execution + # + # So, they can all share one cache. + # + # If the key isn't present, the given block is called and the result is cached for `key`. + # + # @param ctx [GraphQL::Query::Context] + # @param key [Class, GraphQL::Field] A part of the schema + # @param trace_phase [Symbol] The stage of execution being traced (used by OpenTelementry tracing) + # @return [String] + # + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:130 + def cached_platform_key(ctx, key, trace_phase); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:110 + def fallback_transaction_name(context); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:114 + def options; end + + # Get the transaction name based on the operation type and name if possible, or fall back to a user provided + # one. Useful for anonymous queries. + # + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:98 + def transaction_name(query); end + + class << self + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:14 + def inherited(child_class); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:12 + def platform_keys; end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:12 + def platform_keys=(_arg0); end + + # pkg:gem/graphql#lib/graphql/tracing/platform_tracing.rb:75 + def use(schema_defn, options = T.unsafe(nil)); end + end +end + +# A tracer for reporting GraphQL-Ruby times to Prometheus. +# +# The PrometheusExporter server must be run with a custom type collector that extends `GraphQL::Tracing::PrometheusTracing::GraphQLCollector`. +# +# @example Adding this trace to your schema +# require 'prometheus_exporter/client' +# +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::PrometheusTrace +# end +# +# @example Running a custom type collector +# # lib/graphql_collector.rb +# if defined?(PrometheusExporter::Server) +# require 'graphql/tracing' +# +# class GraphQLCollector < GraphQL::Tracing::PrometheusTrace::GraphQLCollector +# end +# end +# +# # Then run: +# # bundle exec prometheus_exporter -a lib/graphql_collector.rb +# +# pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 +module GraphQL::Tracing::PrometheusTrace + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def initialize(client: T.unsafe(nil), keys_whitelist: T.unsafe(nil), collector_type: T.unsafe(nil), **rest); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:43 + def prometheus_client; end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:43 + def prometheus_collector_type; end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:43 + def prometheus_keys_whitelist; end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def setup_prometheus_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def begin_prometheus_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:29 + def finish_prometheus_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::PrometheusTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::PrometheusTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:45 +class GraphQL::Tracing::PrometheusTrace::PrometheusMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:58 + def active?(keyword); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:62 + def gettime; end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:46 + def instrument(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:66 + def send_json(duration, keyword, object); end +end + +# pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:78 +class GraphQL::Tracing::PrometheusTrace::PrometheusMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:83 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_trace.rb:79 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:7 +class GraphQL::Tracing::PrometheusTracing < ::GraphQL::Tracing::PlatformTracing + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:24 + def initialize(opts = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:41 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:37 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:45 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:32 + def platform_trace(platform_key, key, _data, &block); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:51 + def instrument_execution(platform_key, key, &block); end + + # pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:59 + def observe(platform_key, key, duration); end +end + +# pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:9 +GraphQL::Tracing::PrometheusTracing::DEFAULT_COLLECTOR_TYPE = T.let(T.unsafe(nil), String) + +# pkg:gem/graphql#lib/graphql/tracing/prometheus_tracing.rb:8 +GraphQL::Tracing::PrometheusTracing::DEFAULT_WHITELIST = T.let(T.unsafe(nil), Array) + +# A tracer for sending GraphQL-Ruby times to Scout +# +# @example Adding this tracer to your schema +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::ScoutTrace +# end +# +# pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 +module GraphQL::Tracing::ScoutTrace + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def setup_scout_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def begin_scout_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:13 + def finish_scout_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::ScoutTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::ScoutTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:15 +class GraphQL::Tracing::ScoutTrace::ScoutMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLSuffixNames + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:16 + def instrument(keyword, object); end +end + +# pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:34 +class GraphQL::Tracing::ScoutTrace::ScoutMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:42 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:35 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/scout_trace.rb:30 +GraphQL::Tracing::ScoutTrace::ScoutMonitor::INSTRUMENT_OPTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:7 +class GraphQL::Tracing::ScoutTracing < ::GraphQL::Tracing::PlatformTracing + # @param set_transaction_name [Boolean] If true, the GraphQL operation name will be used as the transaction name. + # This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing. + # It can also be specified per-query with `context[:set_scout_transaction_name]`. + # + # pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:24 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:47 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:43 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:51 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:30 + def platform_trace(platform_key, key, data); end +end + +# pkg:gem/graphql#lib/graphql/tracing/scout_tracing.rb:8 +GraphQL::Tracing::ScoutTracing::INSTRUMENT_OPTS = T.let(T.unsafe(nil), Hash) + +# A tracer for reporting GraphQL-Ruby times to Sentry. +# +# @example Installing the tracer +# class MySchema < GraphQL::Schema +# trace_with GraphQL::Tracing::SentryTrace +# end +# @see MonitorTrace Configuration Options in the parent module +# +# pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 +module GraphQL::Tracing::SentryTrace + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def setup_sentry_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def begin_sentry_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:14 + def finish_sentry_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::SentryTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::SentryTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:16 +class GraphQL::Tracing::SentryTrace::SentryMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:17 + def instrument(keyword, object); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:58 + def operation_name(query); end +end + +# pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:67 +class GraphQL::Tracing::SentryTrace::SentryMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:75 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/sentry_trace.rb:68 + def start; end +end + +# A tracer for reporting GraphQL-Ruby times to Statsd. +# Passing any Statsd client that implements `.time(name) { ... }` +# and `.timing(name, ms)` will work. +# +# @example Installing this tracer +# # eg: +# # $statsd = Statsd.new 'localhost', 9125 +# class MySchema < GraphQL::Schema +# use GraphQL::Tracing::StatsdTrace, statsd: $statsd +# end +# +# pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 +module GraphQL::Tracing::StatsdTrace + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def initialize(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_authorized(type, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_execute_field(field, object, arguments, query); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def dataloader_fiber_resume(source); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def dataloader_fiber_yield(source); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def end_analyze_multiplex(multiplex, analyzers); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def end_authorized(type, object, context, result); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def end_dataloader_source(source); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def end_execute_field(field, object, arguments, query, result); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def setup_statsd_monitor(trace_scalars: T.unsafe(nil), trace_authorized: T.unsafe(nil), trace_resolve_type: T.unsafe(nil), set_transaction_name: T.unsafe(nil), **kwargs); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def validate(query:, validate:); end + + private + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def begin_statsd_event(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:17 + def finish_statsd_event; end +end + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:263 +GraphQL::Tracing::StatsdTrace::CURRENT_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/monitor_trace.rb:264 +GraphQL::Tracing::StatsdTrace::PREVIOUS_EV_KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:19 +class GraphQL::Tracing::StatsdTrace::StatsdMonitor < ::GraphQL::Tracing::MonitorTrace::Monitor + include ::GraphQL::Tracing::MonitorTrace::Monitor::GraphQLPrefixNames + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:20 + def initialize(statsd:, **_rest); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:27 + def instrument(keyword, object); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:25 + def statsd; end +end + +# pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:35 +class GraphQL::Tracing::StatsdTrace::StatsdMonitor::Event < ::GraphQL::Tracing::MonitorTrace::Monitor::Event + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:40 + def finish; end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_trace.rb:36 + def start; end +end + +# pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:7 +class GraphQL::Tracing::StatsdTracing < ::GraphQL::Tracing::PlatformTracing + # @param statsd [Object] A statsd client + # + # pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:20 + def initialize(statsd:, **rest); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:35 + def platform_authorized_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:31 + def platform_field_key(type, field); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:39 + def platform_resolve_type_key(type); end + + # pkg:gem/graphql#lib/graphql/tracing/statsd_tracing.rb:25 + def platform_trace(platform_key, key, data); end +end + +# This is the base class for a `trace` instance whose methods are called during query execution. +# "Trace modes" are subclasses of this with custom tracing modules mixed in. +# +# A trace module may implement any of the methods on `Trace`, being sure to call `super` +# to continue any tracing hooks and call the actual runtime behavior. +# +# pkg:gem/graphql#lib/graphql/tracing/trace.rb:13 +class GraphQL::Tracing::Trace + # @param multiplex [GraphQL::Execution::Multiplex, nil] + # @param query [GraphQL::Query, nil] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:16 + def initialize(multiplex: T.unsafe(nil), query: T.unsafe(nil), **_options); end + + # @param multiplex [GraphQL::Execution::Multiplex] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:52 + def analyze_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:56 + def analyze_query(query:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:97 + def authorized(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:123 + def authorized_lazy(query:, type:, object:); end + + # @param multiplex [GraphQL::Execution::Multiplex] + # @param analyzers [Array] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:45 + def begin_analyze_multiplex(multiplex, analyzers); end + + # A call to `.authorized?` is starting + # @param type [Class] + # @param object [Object] + # @param context [GraphQL::Query::Context] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:112 + def begin_authorized(type, object, context); end + + # A dataloader run is starting + # @param dataloader [GraphQL::Dataloader] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:155 + def begin_dataloader(dataloader); end + + # A source with pending keys is about to fetch + # @param source [GraphQL::Dataloader::Source] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:164 + def begin_dataloader_source(source); end + + # GraphQL is about to resolve this field + # @param field [GraphQL::Schema::Field] + # @param object [GraphQL::Schema::Object] + # @param arguments [Hash] + # @param query [GraphQL::Query] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:80 + def begin_execute_field(field, object, arguments, query); end + + # A call to `.resolve_type` is starting + # @param type [Class, Module] + # @param value [Object] + # @param context [GraphQL::Query::Context] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:140 + def begin_resolve_type(type, value, context); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:36 + def begin_validate(query, validate); end + + # Called when an execution or source fiber terminates + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:180 + def dataloader_fiber_exit; end + + # Called when a Dataloader fiber is resumed because data has been loaded + # @param source [GraphQL::Dataloader::Source] The Source whose `load` call previously caused this Fiber to wait + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:189 + def dataloader_fiber_resume(source); end + + # Called when a Dataloader fiber is paused to wait for data + # @param source [GraphQL::Dataloader::Source] The Source whose `load` call initiated this `yield` + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:185 + def dataloader_fiber_yield(source); end + + # Called when Dataloader spins up a new fiber for GraphQL execution + # @param jobs [Array<#call>] Execution steps to run + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:173 + def dataloader_spawn_execution_fiber(jobs); end + + # Called when Dataloader spins up a new fiber for fetching data + # @param pending_sources [GraphQL::Dataloader::Source] Instances with pending keys + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:177 + def dataloader_spawn_source_fiber(pending_sources); end + + # @param multiplex [GraphQL::Execution::Multiplex] + # @param analyzers [Array] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:49 + def end_analyze_multiplex(multiplex, analyzers); end + + # A call to `.authorized?` just finished + # @param type [Class] + # @param object [Object] + # @param context [GraphQL::Query::Context] + # @param authorized_result [Boolean] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:120 + def end_authorized(type, object, context, authorized_result); end + + # A dataloader run has ended + # @param dataloder [GraphQL::Dataloader] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:159 + def end_dataloader(dataloader); end + + # A fetch call has just ended + # @param source [GraphQL::Dataloader::Source] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:168 + def end_dataloader_source(source); end + + # GraphQL just finished resolving this field + # @param field [GraphQL::Schema::Field] + # @param object [GraphQL::Schema::Object] + # @param arguments [Hash] + # @param query [GraphQL::Query] + # @param result [Object] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:87 + def end_execute_field(field, object, arguments, query, result); end + + # A call to `.resolve_type` just ended + # @param type [Class, Module] + # @param value [Object] + # @param context [GraphQL::Query::Context] + # @param resolved_type [Class] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:149 + def end_resolve_type(type, value, context, resolved_type); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:39 + def end_validate(query, validate, errors); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:89 + def execute_field(field:, query:, ast_node:, arguments:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:93 + def execute_field_lazy(field:, query:, ast_node:, arguments:, object:); end + + # This wraps an entire `.execute` call. + # @param multiplex [GraphQL::Execution::Multiplex] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:63 + def execute_multiplex(multiplex:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:67 + def execute_query(query:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:71 + def execute_query_lazy(query:, multiplex:); end + + # The Ruby parser doesn't call this method (`graphql/c_parser` does.) + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:22 + def lex(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:104 + def object_loaded(argument_definition, object, context); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:101 + def objects(type, object, context); end + + # @param query_string [String] + # @return [void] + # + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:28 + def parse(query_string:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:127 + def resolve_type(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:131 + def resolve_type_lazy(query:, type:, object:); end + + # pkg:gem/graphql#lib/graphql/tracing/trace.rb:32 + def validate(query:, validate:); end +end + +# Objects may include traceable to gain a `.trace(...)` method. +# The object must have a `@tracers` ivar of type `Array<<#trace(k, d, &b)>>`. +# @api private +# +# pkg:gem/graphql#lib/graphql/tracing.rb:41 +module GraphQL::Tracing::Traceable + # @param key [String] The name of the event in GraphQL internals + # @param metadata [Hash] Event-related metadata (can be anything) + # @return [Object] Must return the value of the block + # + # pkg:gem/graphql#lib/graphql/tracing.rb:45 + def trace(key, metadata, &block); end + + private + + # If there's a tracer at `idx`, call it and then increment `idx`. + # Otherwise, yield. + # + # @param idx [Integer] Which tracer to call + # @param key [String] The current event name + # @param metadata [Object] The current event object + # @return Whatever the block returns + # + # pkg:gem/graphql#lib/graphql/tracing.rb:59 + def call_tracers(idx, key, metadata, &block); end +end + +# Type kinds are the basic categories which a type may belong to (`Object`, `Scalar`, `Union`...) +# +# pkg:gem/graphql#lib/graphql/type_kinds.rb:4 +module GraphQL::TypeKinds; end + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:75 +GraphQL::TypeKinds::ENUM = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:76 +GraphQL::TypeKinds::INPUT_OBJECT = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:73 +GraphQL::TypeKinds::INTERFACE = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:77 +GraphQL::TypeKinds::LIST = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:78 +GraphQL::TypeKinds::NON_NULL = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:72 +GraphQL::TypeKinds::OBJECT = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:71 +GraphQL::TypeKinds::SCALAR = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:70 +GraphQL::TypeKinds::TYPE_KINDS = T.let(T.unsafe(nil), Array) + +# These objects are singletons, eg `GraphQL::TypeKinds::UNION`, `GraphQL::TypeKinds::SCALAR`. +# +# pkg:gem/graphql#lib/graphql/type_kinds.rb:6 +class GraphQL::TypeKinds::TypeKind + # pkg:gem/graphql#lib/graphql/type_kinds.rb:8 + def initialize(name, abstract: T.unsafe(nil), leaf: T.unsafe(nil), fields: T.unsafe(nil), wraps: T.unsafe(nil), input: T.unsafe(nil), description: T.unsafe(nil)); end + + # Is this TypeKind abstract? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:24 + def abstract?; end + + # Is this TypeKind composed of many values? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:35 + def composite?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:7 + def description; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:53 + def enum?; end + + # Does this TypeKind have queryable fields? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:26 + def fields?; end + + # Is this TypeKind a valid query input? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:30 + def input?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:57 + def input_object?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:45 + def interface?; end + + # Is this TypeKind a primitive value? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:33 + def leaf?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:61 + def list?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:7 + def name; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:65 + def non_null?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:41 + def object?; end + + # Does this TypeKind have multiple possible implementers? + # @deprecated Use `abstract?` instead of `resolves?`. + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:22 + def resolves?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:37 + def scalar?; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:31 + def to_s; end + + # pkg:gem/graphql#lib/graphql/type_kinds.rb:49 + def union?; end + + # Does this TypeKind modify another type? + # + # pkg:gem/graphql#lib/graphql/type_kinds.rb:28 + def wraps?; end +end + +# pkg:gem/graphql#lib/graphql/type_kinds.rb:74 +GraphQL::TypeKinds::UNION = T.let(T.unsafe(nil), GraphQL::TypeKinds::TypeKind) + +# pkg:gem/graphql#lib/graphql/types.rb:4 +module GraphQL::Types + extend ::GraphQL::Autoload +end + +# pkg:gem/graphql#lib/graphql/types/big_int.rb:5 +class GraphQL::Types::BigInt < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/big_int.rb:8 + def coerce_input(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/big_int.rb:14 + def coerce_result(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/big_int.rb:18 + def parse_int(value); end + end +end + +# pkg:gem/graphql#lib/graphql/types/boolean.rb:4 +class GraphQL::Types::Boolean < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/boolean.rb:7 + def coerce_input(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/boolean.rb:11 + def coerce_result(value, _ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/types/float.rb:5 +class GraphQL::Types::Float < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/float.rb:8 + def coerce_input(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/float.rb:12 + def coerce_result(value, _ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/types/id.rb:4 +class GraphQL::Types::ID < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/id.rb:12 + def coerce_input(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/id.rb:8 + def coerce_result(value, _ctx); end + end +end + +# This scalar takes `Date`s and transmits them as strings, +# using ISO 8601 format. +# +# Use it for fields or arguments as follows: +# +# field :published_at, GraphQL::Types::ISO8601Date, null: false +# +# argument :deliver_at, GraphQL::Types::ISO8601Date, null: false +# +# Alternatively, use this built-in scalar as inspiration for your +# own Date type. +# +# pkg:gem/graphql#lib/graphql/types/iso_8601_date.rb:15 +class GraphQL::Types::ISO8601Date < ::GraphQL::Schema::Scalar + class << self + # @param str_value [String, Date, DateTime, Time] + # @return [Date, nil] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date.rb:27 + def coerce_input(value, ctx); end + + # @param value [Date,Time,DateTime,String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date.rb:21 + def coerce_result(value, _ctx); end + end +end + +# This scalar takes `Time`s and transmits them as strings, +# using ISO 8601 format. +# +# Use it for fields or arguments as follows: +# +# field :created_at, GraphQL::Types::ISO8601DateTime, null: false +# +# argument :deliver_at, GraphQL::Types::ISO8601DateTime, null: false +# +# Alternatively, use this built-in scalar as inspiration for your +# own DateTime type. +# +# pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:18 +class GraphQL::Types::ISO8601DateTime < ::GraphQL::Schema::Scalar + class << self + # @param str_value [String] + # @return [Time] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:54 + def coerce_input(str_value, _ctx); end + + # @param value [Time,Date,DateTime,String] + # @return [String] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:38 + def coerce_result(value, _ctx); end + + # @return [Integer] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:27 + def time_precision; end + + # @param [Integer] value + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:32 + def time_precision=(value); end + end +end + +# It's not compatible with Rails' default, +# i.e. ActiveSupport::JSON::Encoder.time_precision (3 by default) +# +# pkg:gem/graphql#lib/graphql/types/iso_8601_date_time.rb:24 +GraphQL::Types::ISO8601DateTime::DEFAULT_TIME_PRECISION = T.let(T.unsafe(nil), Integer) + +# This scalar takes `Duration`s and transmits them as strings, +# using ISO 8601 format. ActiveSupport >= 5.0 must be loaded to use +# this scalar. +# +# Use it for fields or arguments as follows: +# +# field :age, GraphQL::Types::ISO8601Duration, null: false +# +# argument :interval, GraphQL::Types::ISO8601Duration, null: false +# +# Alternatively, use this built-in scalar as inspiration for your +# own Duration type. +# +# pkg:gem/graphql#lib/graphql/types/iso_8601_duration.rb:16 +class GraphQL::Types::ISO8601Duration < ::GraphQL::Schema::Scalar + class << self + # @param value [String, ActiveSupport::Duration] + # @return [ActiveSupport::Duration, nil] + # @raise [GraphQL::Error] if ActiveSupport::Duration is not defined + # @raise [GraphQL::DurationEncodingError] if duration cannot be parsed + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_duration.rb:57 + def coerce_input(value, ctx); end + + # @param value [ActiveSupport::Duration, String] + # @return [String] + # @raise [GraphQL::Error] if ActiveSupport::Duration is not defined or if an incompatible object is passed + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_duration.rb:33 + def coerce_result(value, _ctx); end + + # @return [Integer, nil] + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_duration.rb:20 + def seconds_precision; end + + # @param [Integer, nil] value + # + # pkg:gem/graphql#lib/graphql/types/iso_8601_duration.rb:26 + def seconds_precision=(value); end + end +end + +# @see {Types::BigInt} for handling integers outside 32-bit range. +# +# pkg:gem/graphql#lib/graphql/types/int.rb:6 +class GraphQL::Types::Int < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/int.rb:12 + def coerce_input(value, ctx); end + + # pkg:gem/graphql#lib/graphql/types/int.rb:23 + def coerce_result(value, ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/types/int.rb:10 +GraphQL::Types::Int::MAX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/graphql#lib/graphql/types/int.rb:9 +GraphQL::Types::Int::MIN = T.let(T.unsafe(nil), Integer) + +# An untyped JSON scalar that maps to Ruby hashes, arrays, strings, integers, floats, booleans and nils. +# This should be used judiciously because it subverts the GraphQL type system. +# +# Use it for fields or arguments as follows: +# +# field :template_parameters, GraphQL::Types::JSON, null: false +# +# argument :template_parameters, GraphQL::Types::JSON, null: false +# +# pkg:gem/graphql#lib/graphql/types/json.rb:13 +class GraphQL::Types::JSON < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/json.rb:16 + def coerce_input(value, _context); end + + # pkg:gem/graphql#lib/graphql/types/json.rb:20 + def coerce_result(value, _context); end + end +end + +# This module contains some types and fields that could support Relay conventions in GraphQL. +# +# You can use these classes out of the box if you want, but if you want to use your _own_ +# GraphQL extensions along with the features in this code, you could also +# open up the source files and copy the relevant methods and configuration into +# your own classes. +# +# For example, the provided object types extend {Types::Relay::BaseObject}, +# but you might want to: +# +# 1. Migrate the extensions from {Types::Relay::BaseObject} into _your app's_ base object +# 2. Copy {Relay::BaseConnection}, {Relay::BaseEdge}, etc into _your app_, and +# change them to extend _your_ base object. +# +# Similarly, `BaseField`'s extensions could be migrated to your app +# and `Node` could be implemented to mix in your base interface module. +# +# pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:5 +module GraphQL::Types::Relay; end + +# Use this to implement Relay connections, or take it as inspiration +# for Relay classes in your own app. +# +# You may wish to copy this code into your own base class, +# so you can extend your own `BaseObject` instead of `GraphQL::Schema::Object`. +# +# @example Implementation a connection and edge +# class BaseObject < GraphQL::Schema::Object; end +# +# # Given some object in your app ... +# class Types::Post < BaseObject +# end +# +# # Make a couple of base classes: +# class Types::BaseEdge < GraphQL::Types::Relay::BaseEdge; end +# class Types::BaseConnection < GraphQL::Types::Relay::BaseConnection; end +# +# # Then extend them for the object in your app +# class Types::PostEdge < Types::BaseEdge +# node_type Types::Post +# end +# +# class Types::PostConnection < Types::BaseConnection +# edge_type Types::PostEdge, +# edges_nullable: true, +# edge_nullable: true, +# node_nullable: true, +# nodes_field: true +# +# # Alternatively, you can call the class methods followed by your edge type +# # edges_nullable true +# # edge_nullable true +# # node_nullable true +# # has_nodes_field true +# # edge_type Types::PostEdge +# end +# +# @see Relay::BaseEdge for edge types +# +# pkg:gem/graphql#lib/graphql/types/relay/base_connection.rb:44 +class GraphQL::Types::Relay::BaseConnection < ::GraphQL::Schema::Object + include ::GraphQL::Types::Relay::ConnectionBehaviors + extend ::GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + extend ::GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +end + +# A class-based definition for Relay edges. +# +# Use this as a parent class in your app, or use it as inspiration for your +# own base `Edge` class. +# +# For example, you may want to extend your own `BaseObject` instead of the +# built-in `GraphQL::Schema::Object`. +# +# @example Making a UserEdge type +# # Make a base class for your app +# class Types::BaseEdge < GraphQL::Types::Relay::BaseEdge +# end +# +# # Then extend your own base class +# class Types::UserEdge < Types::BaseEdge +# node_type(Types::User) +# end +# +# @see {Relay::BaseConnection} for connection types +# +# pkg:gem/graphql#lib/graphql/types/relay/base_edge.rb:24 +class GraphQL::Types::Relay::BaseEdge < ::GraphQL::Schema::Object + include ::GraphQL::Types::Relay::EdgeBehaviors + extend ::GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + extend ::GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +end + +# pkg:gem/graphql#lib/graphql/types/relay/page_info_behaviors.rb:23 +module GraphQL::Types::Relay::ClassMethods + # pkg:gem/graphql#lib/graphql/types/relay/page_info_behaviors.rb:28 + def default_broadcastable?; end + + # pkg:gem/graphql#lib/graphql/types/relay/page_info_behaviors.rb:24 + def default_relay?; end +end + +# pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:6 +module GraphQL::Types::Relay::ConnectionBehaviors + extend ::Forwardable + + mixes_in_class_methods ::GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:8 + def cursor_from_node(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:196 + def edges; end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:206 + def nodes; end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:8 + def parent(*_arg0, **_arg1, &_arg2); end + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:191 + def add_page_info_field(obj_type); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:10 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:25 +module GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:118 + def authorized?(obj, ctx); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:46 + def default_broadcastable(new_value); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:42 + def default_broadcastable?; end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:38 + def default_relay?; end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:54 + def edge_class; end + + # Set the default `edge_nullable` for this class and its child classes. (Defaults to `true`.) + # Use `edge_nullable(false)` in your base class to make non-null `edge` fields. + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:149 + def edge_nullable(new_value = T.unsafe(nil)); end + + # Configure this connection to return `edges` and `nodes` based on `edge_type_class`. + # + # This method will use the inputs to create: + # - `edges` field + # - `nodes` field + # - description + # + # It's called when you subclass this base connection, trying to use the + # class name to set defaults. You can call it again in the class definition + # to override the default (or provide a value, if the default lookup failed). + # @param field_options [Hash] Any extra keyword arguments to pass to the `field :edges, ...` and `field :nodes, ...` configurations + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:67 + def edge_type(edge_type_class, edge_class: T.unsafe(nil), node_type: T.unsafe(nil), nodes_field: T.unsafe(nil), node_nullable: T.unsafe(nil), edges_nullable: T.unsafe(nil), edge_nullable: T.unsafe(nil), field_options: T.unsafe(nil)); end + + # Set the default `edges_nullable` for this class and its child classes. (Defaults to `true`.) + # Use `edges_nullable(false)` in your base class to make non-null `edges` fields. + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:139 + def edges_nullable(new_value = T.unsafe(nil)); end + + # Set the default `nodes_field` for this class and its child classes. (Defaults to `true`.) + # Use `nodes_field(false)` in your base class to prevent adding of a nodes field. + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:159 + def has_nodes_field(new_value = T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:26 + def inherited(child_class); end + + # Set the default `node_nullable` for this class and its child classes. (Defaults to `true`.) + # Use `node_nullable(false)` in your base class to make non-null `node` and `nodes` fields. + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:129 + def node_nullable(new_value = T.unsafe(nil)); end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:51 + def node_type; end + + # Add the shortcut `nodes` field to this connection and its subclasses + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:114 + def nodes_field(node_nullable: T.unsafe(nil), field_options: T.unsafe(nil)); end + + # The connection will skip auth on its nodes if the node_type is configured for that + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:101 + def reauthorize_scoped_objects(new_value = T.unsafe(nil)); end + + # Filter this list according to the way its node type would scope them + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:96 + def scope_items(items, context); end + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:122 + def visible?(ctx); end + + protected + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:169 + def edge_class=(_arg0); end + + # Configure this connection to return `edges` and `nodes` based on `edge_type_class`. + # + # This method will use the inputs to create: + # - `edges` field + # - `nodes` field + # - description + # + # It's called when you subclass this base connection, trying to use the + # class name to set defaults. You can call it again in the class definition + # to override the default (or provide a value, if the default lookup failed). + # @param field_options [Hash] Any extra keyword arguments to pass to the `field :edges, ...` and `field :nodes, ...` configurations + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:169 + def edge_type=(_arg0); end + + # @return [Class] + # + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:169 + def node_type=(_arg0); end + + private + + # pkg:gem/graphql#lib/graphql/types/relay/connection_behaviors.rb:173 + def define_nodes_field(nullable, field_options: T.unsafe(nil)); end +end + +# pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:6 +module GraphQL::Types::Relay::EdgeBehaviors + mixes_in_class_methods ::GraphQL::Types::Relay::EdgeBehaviors::ClassMethods + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:16 + def node; end + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:7 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:24 +module GraphQL::Types::Relay::EdgeBehaviors::ClassMethods + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:68 + def authorized?(obj, ctx); end + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:40 + def default_broadcastable(new_value); end + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:36 + def default_broadcastable?; end + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:32 + def default_relay?; end + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:25 + def inherited(child_class); end + + # Set the default `node_nullable` for this class and its child classes. (Defaults to `true`.) + # Use `node_nullable(false)` in your base class to make non-null `node` field. + # + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:78 + def node_nullable(new_value = T.unsafe(nil)); end + + # Get or set the Object type that this edge wraps. + # + # @param node_type [Class] A `Schema::Object` subclass + # @param null [Boolean] + # @param field_options [Hash] Any extra arguments to pass to the `field :node` configuration + # + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:49 + def node_type(node_type = T.unsafe(nil), null: T.unsafe(nil), field_options: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:72 + def visible?(ctx); end + + protected + + # Set the default `node_nullable` for this class and its child classes. (Defaults to `true`.) + # Use `node_nullable(false)` in your base class to make non-null `node` field. + # + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:88 + def node_nullable=(_arg0); end + + # Get or set the Object type that this edge wraps. + # + # @param node_type [Class] A `Schema::Object` subclass + # @param null [Boolean] + # @param field_options [Hash] Any extra arguments to pass to the `field :node` configuration + # + # pkg:gem/graphql#lib/graphql/types/relay/edge_behaviors.rb:88 + def node_type=(_arg0); end +end + +# Include this module to your root Query type to get a Relay-compliant `node(id: ID!): Node` field that uses the schema's `object_from_id` hook. +# +# pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:7 +module GraphQL::Types::Relay::HasNodeField + mixes_in_class_methods ::GraphQL::Types::Relay::HasNodeField::ExecutionMethods + + # pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:19 + def get_relay_node(id:); end + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:36 + def field_block; end + + # pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:24 + def field_options; end + + # pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:8 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:13 +module GraphQL::Types::Relay::HasNodeField::ExecutionMethods + # pkg:gem/graphql#lib/graphql/types/relay/has_node_field.rb:14 + def get_relay_node(context, id:); end +end + +# Include this module to your root Query type to get a Relay-style `nodes(id: ID!): [Node]` field that uses the schema's `object_from_id` hook. +# +# pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:7 +module GraphQL::Types::Relay::HasNodesField + mixes_in_class_methods ::GraphQL::Types::Relay::HasNodesField::ExecutionMethods + + # pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:19 + def get_relay_nodes(ids:); end + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:36 + def field_block; end + + # pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:24 + def field_options; end + + # pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:8 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:13 +module GraphQL::Types::Relay::HasNodesField::ExecutionMethods + # pkg:gem/graphql#lib/graphql/types/relay/has_nodes_field.rb:14 + def get_relay_nodes(context, ids:); end +end + +# This can be used for Relay's `Node` interface, +# or you can take it as inspiration for your own implementation +# of the `Node` interface. +# +# pkg:gem/graphql#lib/graphql/types/relay/node.rb:9 +module GraphQL::Types::Relay::Node + include ::GraphQL::Schema::Member::GraphQLTypeNames + include ::GraphQL::Schema::Interface + include ::GraphQL::Types::Relay::NodeBehaviors + extend ::GraphQL::Schema::FindInheritedValue + extend ::GraphQL::EmptyObjects + extend ::GraphQL::Schema::Member::BaseDSLMethods + extend ::GraphQL::Schema::Member::TypeSystemHelpers + extend ::GraphQL::Schema::Member::HasFields + extend ::GraphQL::Schema::Member::HasFields::InterfaceMethods + extend ::GraphQL::Schema::Member::HasPath + extend ::GraphQL::Schema::Member::RelayShortcuts + extend ::GraphQL::Schema::Member::Scoped + extend ::GraphQL::Schema::Member::HasAstNode + extend ::GraphQL::Schema::Member::HasUnresolvedTypeError + extend ::GraphQL::Schema::Member::HasDataloader + extend ::GraphQL::Schema::Member::HasDirectives + extend ::GraphQL::Schema::Member::HasInterfaces + extend ::GraphQL::Schema::Interface::DefinitionMethods + extend ::GraphQL::Types::Relay::NodeBehaviors::ClassMethods + extend ::GraphQL::Types::Relay::NodeBehaviors::ExecutionMethods + + mixes_in_class_methods ::GraphQL::Types::Relay::NodeBehaviors::ExecutionMethods +end + +# pkg:gem/graphql#lib/graphql/types/relay/node.rb:10 +class GraphQL::Types::Relay::Node::UnresolvedTypeError < ::GraphQL::UnresolvedTypeError; end + +# pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:6 +module GraphQL::Types::Relay::NodeBehaviors + mixes_in_class_methods ::GraphQL::Types::Relay::NodeBehaviors::ClassMethods + mixes_in_class_methods ::GraphQL::Types::Relay::NodeBehaviors::ExecutionMethods + + # pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:14 + def default_global_id; end + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:7 + def included(child_module); end + end +end + +# pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:18 +module GraphQL::Types::Relay::NodeBehaviors::ClassMethods + # pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:19 + def default_relay?; end +end + +# pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:24 +module GraphQL::Types::Relay::NodeBehaviors::ExecutionMethods + # pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:25 + def default_global_id(object, context); end + + # pkg:gem/graphql#lib/graphql/types/relay/node_behaviors.rb:29 + def included(child_class); end +end + +# The return type of a connection's `pageInfo` field +# +# pkg:gem/graphql#lib/graphql/types/relay/page_info.rb:6 +class GraphQL::Types::Relay::PageInfo < ::GraphQL::Schema::Object + include ::GraphQL::Types::Relay::PageInfoBehaviors + extend ::GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + extend ::GraphQL::Types::Relay::ClassMethods +end + +# pkg:gem/graphql#lib/graphql/types/relay/page_info_behaviors.rb:5 +module GraphQL::Types::Relay::PageInfoBehaviors + mixes_in_class_methods ::GraphQL::Types::Relay::ClassMethods + + class << self + # pkg:gem/graphql#lib/graphql/types/relay/page_info_behaviors.rb:6 + def included(child_class); end + end +end + +# pkg:gem/graphql#lib/graphql/types/string.rb:5 +class GraphQL::Types::String < ::GraphQL::Schema::Scalar + class << self + # pkg:gem/graphql#lib/graphql/types/string.rb:22 + def coerce_input(value, _ctx); end + + # pkg:gem/graphql#lib/graphql/types/string.rb:8 + def coerce_result(value, ctx); end + end +end + +# pkg:gem/graphql#lib/graphql/unauthorized_enum_value_error.rb:3 +class GraphQL::UnauthorizedEnumValueError < ::GraphQL::UnauthorizedError + # pkg:gem/graphql#lib/graphql/unauthorized_enum_value_error.rb:7 + def initialize(type:, context:, enum_value:); end + + # @return [GraphQL::Schema::EnumValue] The value whose `#authorized?` check returned false + # + # pkg:gem/graphql#lib/graphql/unauthorized_enum_value_error.rb:5 + def enum_value; end + + # @return [GraphQL::Schema::EnumValue] The value whose `#authorized?` check returned false + # + # pkg:gem/graphql#lib/graphql/unauthorized_enum_value_error.rb:5 + def enum_value=(_arg0); end +end + +# When an `authorized?` hook returns false, this error is used to communicate the failure. +# It's passed to {Schema.unauthorized_object}. +# +# Alternatively, custom code in `authorized?` may raise this error. It will be routed the same way. +# +# pkg:gem/graphql#lib/graphql/unauthorized_error.rb:7 +class GraphQL::UnauthorizedError < ::GraphQL::RuntimeError + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:17 + def initialize(message = T.unsafe(nil), object: T.unsafe(nil), type: T.unsafe(nil), context: T.unsafe(nil)); end + + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:31 + def ast_nodes; end + + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:31 + def ast_nodes=(_arg0); end + + # @return [GraphQL::Query::Context] the context for the current query + # + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:15 + def context; end + + # @return [GraphQL::Query::Context] the context for the current query + # + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:15 + def context=(_arg0); end + + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:33 + def finalize_graphql_result(query, result_data, key); end + + # @return [Object] the application object that failed the authorization check + # + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:9 + def object; end + + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:31 + def path; end + + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:31 + def path=(_arg0); end + + # @return [Class] the GraphQL object type whose `.authorized?` method was called (and returned false) + # + # pkg:gem/graphql#lib/graphql/unauthorized_error.rb:12 + def type; end +end + +# pkg:gem/graphql#lib/graphql/unauthorized_field_error.rb:3 +class GraphQL::UnauthorizedFieldError < ::GraphQL::UnauthorizedError + # pkg:gem/graphql#lib/graphql/unauthorized_field_error.rb:7 + def initialize(message = T.unsafe(nil), object: T.unsafe(nil), type: T.unsafe(nil), context: T.unsafe(nil), field: T.unsafe(nil)); end + + # @return [Field] the field that failed the authorization check + # + # pkg:gem/graphql#lib/graphql/unauthorized_field_error.rb:5 + def field; end + + # @return [Field] the field that failed the authorization check + # + # pkg:gem/graphql#lib/graphql/unauthorized_field_error.rb:5 + def field=(_arg0); end +end + +# Error raised when the value provided for a field +# can't be resolved to one of the possible types for the field. +# +# pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:5 +class GraphQL::UnresolvedTypeError < ::GraphQL::RuntimeTypeError + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:21 + def initialize(value, field, parent_type, resolved_type, possible_types); end + + # @return [GraphQL::Field] The field whose value couldn't be resolved (`field.type` is type which couldn't be resolved) + # + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:10 + def field; end + + # @return [GraphQL::BaseType] The owner of `field` + # + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:13 + def parent_type; end + + # @return [Array] The allowed options for resolving `value` to `field.type` + # + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:19 + def possible_types; end + + # @return [Object] The return of {Schema#resolve_type} for `value` + # + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:16 + def resolved_type; end + + # @return [Object] The runtime value which couldn't be successfully resolved with `resolve_type` + # + # pkg:gem/graphql#lib/graphql/unresolved_type_error.rb:7 + def value; end +end + +# pkg:gem/graphql#lib/graphql/version.rb:3 +GraphQL::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/minitest@5.27.0.rbi b/sorbet/rbi/gems/minitest@5.27.0.rbi new file mode 100644 index 00000000..e8f021d4 --- /dev/null +++ b/sorbet/rbi/gems/minitest@5.27.0.rbi @@ -0,0 +1,1499 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `minitest` gem. +# Please instead update this file by running `bin/tapioca gem minitest`. + + +# The top-level namespace for Minitest. Also the location of the main +# runtime. See +Minitest.run+ for more information. +# :stopdoc: +# +# pkg:gem/minitest#lib/minitest/parallel.rb:3 +module Minitest + class << self + # Internal run method. Responsible for telling all Runnable + # sub-classes to run. + # + # pkg:gem/minitest#lib/minitest.rb:337 + def __run(reporter, options); end + + # A simple hook allowing you to run a block of code after everything + # is done running. Eg: + # + # Minitest.after_run { p $debugging_info } + # + # pkg:gem/minitest#lib/minitest.rb:96 + def after_run(&block); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def allow_fork; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def allow_fork=(_arg0); end + + # Registers Minitest to run at process exit + # + # pkg:gem/minitest#lib/minitest.rb:70 + def autorun; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def backtrace_filter; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def backtrace_filter=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:19 + def cattr_accessor(name); end + + # pkg:gem/minitest#lib/minitest.rb:1231 + def clock_time; end + + # pkg:gem/minitest#lib/minitest.rb:317 + def empty_run!(options); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def extensions; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def extensions=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:350 + def filter_backtrace(bt); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def info_signal; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def info_signal=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:124 + def init_plugins(options); end + + # pkg:gem/minitest#lib/minitest.rb:108 + def load_plugins; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def parallel_executor; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def parallel_executor=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:142 + def process_args(args = T.unsafe(nil)); end + + # Register a plugin to be used. Does NOT require / load it. + # + # pkg:gem/minitest#lib/minitest.rb:103 + def register_plugin(name_or_mod); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def reporter; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def reporter=(_arg0); end + + # This is the top-level run method. Everything starts from here. It + # tells each Runnable sub-class to run, and each of those are + # responsible for doing whatever they do. + # + # The overall structure of a run looks like this: + # + # Minitest.autorun + # Minitest.run(args) + # Minitest.load_plugins + # Minitest.process_args + # Minitest.init_plugins + # Minitest.__run(reporter, options) + # Runnable.runnables.each |runnable_klass| + # runnable_klass.run(reporter, options) + # filtered_methods = runnable_methods.select {...}.reject {...} + # filtered_methods.each |runnable_method| + # runnable_klass.run_one_method(self, runnable_method, reporter) + # Minitest.run_one_method(runnable_klass, runnable_method) + # runnable_klass.new(runnable_method).run + # + # pkg:gem/minitest#lib/minitest.rb:282 + def run(args = T.unsafe(nil)); end + + # pkg:gem/minitest#lib/minitest.rb:1222 + def run_one_method(klass, method_name); end + + # pkg:gem/minitest#lib/minitest.rb:20 + def seed; end + + # pkg:gem/minitest#lib/minitest.rb:20 + def seed=(_arg0); end + end +end + +# Defines the API for Reporters. Subclass this and override whatever +# you want. Go nuts. +# +# pkg:gem/minitest#lib/minitest.rb:702 +class Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:704 + def initialize; end + + # Did this run pass? + # + # pkg:gem/minitest#lib/minitest.rb:739 + def passed?; end + + # About to start running a test. This allows a reporter to show + # that it is starting or that we are in the middle of a test run. + # + # pkg:gem/minitest#lib/minitest.rb:718 + def prerecord(klass, name); end + + # Output and record the result of the test. Call + # {result#result_code}[rdoc-ref:Runnable#result_code] to get the + # result character string. Stores the result of the run if the run + # did not pass. + # + # pkg:gem/minitest#lib/minitest.rb:727 + def record(result); end + + # Outputs the summary of the run. + # + # pkg:gem/minitest#lib/minitest.rb:733 + def report; end + + # Starts reporting on the run. + # + # pkg:gem/minitest#lib/minitest.rb:711 + def start; end + + # pkg:gem/minitest#lib/minitest.rb:743 + def synchronize(&block); end +end + +# Represents run failures. +# +# pkg:gem/minitest#lib/minitest.rb:1035 +class Minitest::Assertion < ::Exception + # pkg:gem/minitest#lib/minitest.rb:1038 + def error; end + + # Where was this run before an assertion was raised? + # + # pkg:gem/minitest#lib/minitest.rb:1045 + def location; end + + # pkg:gem/minitest#lib/minitest.rb:1053 + def result_code; end + + # pkg:gem/minitest#lib/minitest.rb:1057 + def result_label; end +end + +# pkg:gem/minitest#lib/minitest.rb:1036 +Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp) + +# Minitest Assertions. All assertion methods accept a +msg+ which is +# printed if the assertion fails. +# +# Protocol: Nearly everything here boils up to +assert+, which +# expects to be able to increment an instance accessor named +# +assertions+. This is not provided by Assertions and must be +# provided by the thing including Assertions. See Minitest::Runnable +# for an example. +# +# pkg:gem/minitest#lib/minitest/assertions.rb:16 +module Minitest::Assertions + # pkg:gem/minitest#lib/minitest/assertions.rb:199 + def _caller_uplevel; end + + # pkg:gem/minitest#lib/minitest/assertions.rb:181 + def _synchronize; end + + # pkg:gem/minitest#lib/minitest/assertions.rb:194 + def _where; end + + # Fails unless +test+ is truthy. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:171 + def assert(test, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is empty. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:188 + def assert_empty(obj, msg = T.unsafe(nil)); end + + # Fails unless exp == act printing the difference between + # the two, if possible. + # + # If there is no visible difference but the assertion fails, you + # should suspect that your #== is buggy, or your inspect output is + # missing crucial details. For nicer structural diffing, set + # Minitest::Test.make_my_diffs_pretty! + # + # For floats use assert_in_delta. + # + # See also: Minitest::Assertions.diff + # + # pkg:gem/minitest#lib/minitest/assertions.rb:220 + def assert_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ are within +delta+ + # of each other. + # + # assert_in_delta Math::PI, (22.0 / 7.0), 0.01 + # + # pkg:gem/minitest#lib/minitest/assertions.rb:241 + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails unless +exp+ and +act+ have a relative + # error less than +epsilon+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:253 + def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails unless +collection+ includes +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:260 + def assert_includes(collection, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is an instance of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:271 + def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is a kind of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:282 + def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails unless +matcher+ =~ +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:293 + def assert_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails unless +obj+ is nil + # + # pkg:gem/minitest#lib/minitest/assertions.rb:305 + def assert_nil(obj, msg = T.unsafe(nil)); end + + # For testing with binary operators. Eg: + # + # assert_operator 5, :<=, 4 + # + # pkg:gem/minitest#lib/minitest/assertions.rb:315 + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if stdout or stderr do not output the expected results. + # Pass in nil if you don't care about that streams output. Pass in + # "" if you require it to be silent. Pass in a regexp if you want + # to pattern match. + # + # assert_output(/hey/) { method_with_output } + # + # NOTE: this uses #capture_io, not #capture_subprocess_io. + # + # See also: #assert_silent + # + # pkg:gem/minitest#lib/minitest/assertions.rb:333 + def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end + + # Fails unless +path+ exists. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:357 + def assert_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # assert_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # # fail "length mismatch (given 3, expected 1)" + # assert_pattern { [1,2,3] => [Integer] } + # + # The bare => pattern will raise a NoMatchingPatternError on failure, which would + # normally be counted as a test error. This assertion rescues NoMatchingPatternError and + # generates a test failure. Any other exception will be raised as normal and generate a test + # error. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:376 + def assert_pattern; end + + # For testing with predicates. Eg: + # + # assert_predicate str, :empty? + # + # This is really meant for specs and is front-ended by assert_operator: + # + # str.must_be :empty? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:394 + def assert_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails unless the block raises one of +exp+. Returns the + # exception matched so you can check the message, attributes, etc. + # + # +exp+ takes an optional message on the end to help explain + # failures and defaults to StandardError if no exception class is + # passed. Eg: + # + # assert_raises(CustomError) { method_with_custom_error } + # + # With custom error message: + # + # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error } + # + # Using the returned object: + # + # error = assert_raises(CustomError) do + # raise CustomError, 'This is really bad' + # end + # + # assert_equal 'This is really bad', error.message + # + # pkg:gem/minitest#lib/minitest/assertions.rb:421 + def assert_raises(*exp); end + + # Fails unless +obj+ responds to +meth+. + # include_all defaults to false to match Object#respond_to? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:453 + def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails unless +exp+ and +act+ are #equal? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:463 + def assert_same(exp, act, msg = T.unsafe(nil)); end + + # +send_ary+ is a receiver, message and arguments. + # + # Fails unless the call returns a true value + # + # pkg:gem/minitest#lib/minitest/assertions.rb:476 + def assert_send(send_ary, m = T.unsafe(nil)); end + + # Fails if the block outputs anything to stderr or stdout. + # + # See also: #assert_output + # + # pkg:gem/minitest#lib/minitest/assertions.rb:491 + def assert_silent; end + + # Fails unless the block throws +sym+ + # + # pkg:gem/minitest#lib/minitest/assertions.rb:500 + def assert_throws(sym, msg = T.unsafe(nil)); end + + # Captures $stdout and $stderr into strings: + # + # out, err = capture_io do + # puts "Some info" + # warn "You did a bad thing" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: For efficiency, this method uses StringIO and does not + # capture IO for subprocesses. Use #capture_subprocess_io for + # that. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:536 + def capture_io; end + + # Captures $stdout and $stderr into strings, using Tempfile to + # ensure that subprocess IO is captured as well. + # + # out, err = capture_subprocess_io do + # system "echo Some info" + # system "echo You did a bad thing 1>&2" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: This method is approximately 10x slower than #capture_io so + # only use it when you need to test the output of a subprocess. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:569 + def capture_subprocess_io; end + + # Returns a diff between +exp+ and +act+. If there is no known + # diff command or if it doesn't make sense to diff the output + # (single line, short output), then it simply returns a basic + # comparison between the two. + # + # See +things_to_diff+ for more info. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:57 + def diff(exp, act); end + + # Returns details for exception +e+ + # + # pkg:gem/minitest#lib/minitest/assertions.rb:601 + def exception_details(e, msg); end + + # Fails after a given date (in the local time zone). This allows + # you to put time-bombs in your tests if you need to keep + # something around until a later date lest you forget about it. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:617 + def fail_after(y, m, d, msg); end + + # Fails with +msg+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:624 + def flunk(msg = T.unsafe(nil)); end + + # Returns a proc that will output +msg+ along with the default message. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:632 + def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end + + # This returns a human-readable version of +obj+. By default + # #inspect is called. You can override this to use #pretty_inspect + # if you want. + # + # See Minitest::Test.make_my_diffs_pretty! + # + # pkg:gem/minitest#lib/minitest/assertions.rb:127 + def mu_pp(obj); end + + # This returns a diff-able more human-readable version of +obj+. + # This differs from the regular mu_pp because it expands escaped + # newlines and makes hex-values (like object_ids) generic. This + # uses mu_pp to do the first pass and then cleans it up. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:145 + def mu_pp_for_diff(obj); end + + # used for counting assertions + # + # pkg:gem/minitest#lib/minitest/assertions.rb:643 + def pass(_msg = T.unsafe(nil)); end + + # Fails if +test+ is truthy. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:650 + def refute(test, msg = T.unsafe(nil)); end + + # Fails if +obj+ is empty. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:658 + def refute_empty(obj, msg = T.unsafe(nil)); end + + # Fails if exp == act. + # + # For floats use refute_in_delta. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:669 + def refute_equal(exp, act, msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ is within +delta+ of +act+. + # + # refute_in_delta Math::PI, (22.0 / 7.0) + # + # pkg:gem/minitest#lib/minitest/assertions.rb:681 + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # For comparing Floats. Fails if +exp+ and +act+ have a relative error + # less than +epsilon+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:693 + def refute_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +collection+ includes +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:700 + def refute_includes(collection, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is an instance of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:711 + def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is a kind of +cls+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:721 + def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # Fails if +matcher+ =~ +obj+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:729 + def refute_match(matcher, obj, msg = T.unsafe(nil)); end + + # Fails if +obj+ is nil. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:739 + def refute_nil(obj, msg = T.unsafe(nil)); end + + # Fails if +o1+ is not +op+ +o2+. Eg: + # + # refute_operator 1, :>, 2 #=> pass + # refute_operator 1, :<, 2 #=> fail + # + # pkg:gem/minitest#lib/minitest/assertions.rb:771 + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Fails if +path+ exists. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:780 + def refute_path_exists(path, msg = T.unsafe(nil)); end + + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # refute_pattern { [1,2,3] => [String] } + # + # # fail "NoMatchingPatternError expected, but nothing was raised." + # refute_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # This assertion expects a NoMatchingPatternError exception, and will fail if none is raised. Any + # other exceptions will be raised as normal and generate a test error. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:756 + def refute_pattern; end + + # For testing with predicates. + # + # refute_predicate str, :empty? + # + # This is really meant for specs and is front-ended by refute_operator: + # + # str.wont_be :empty? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:794 + def refute_predicate(o1, op, msg = T.unsafe(nil)); end + + # Fails if +obj+ responds to the message +meth+. + # include_all defaults to false to match Object#respond_to? + # + # pkg:gem/minitest#lib/minitest/assertions.rb:803 + def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # Fails if +exp+ is the same (by object identity) as +act+. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:812 + def refute_same(exp, act, msg = T.unsafe(nil)); end + + # Skips the current run. If run in verbose-mode, the skipped run + # gets listed at the end of the run but doesn't cause a failure + # exit code. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:825 + def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end + + # Skips the current run until a given date (in the local time + # zone). This allows you to put some fixes on hold until a later + # date, but still holds you accountable and prevents you from + # forgetting it. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:837 + def skip_until(y, m, d, msg); end + + # Was this testcase skipped? Meant for #teardown. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:846 + def skipped?; end + + # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff. + # + # Criterion: + # + # 1. Strings include newlines or escaped newlines, but not both. + # 2. or: String lengths are > 30 characters. + # 3. or: Strings are equal to each other (but maybe different encodings?). + # 4. and: we found a diff executable. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:102 + def things_to_diff(exp, act); end + + class << self + # Returns the diff command to use in #diff. Tries to intelligently + # figure out what diff to use. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:27 + def diff; end + + # Set the diff command to use in #diff. + # + # pkg:gem/minitest#lib/minitest/assertions.rb:45 + def diff=(o); end + end +end + +# pkg:gem/minitest#lib/minitest/assertions.rb:205 +Minitest::Assertions::E = T.let(T.unsafe(nil), String) + +# pkg:gem/minitest#lib/minitest/assertions.rb:17 +Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object) + +# The standard backtrace filter for minitest. +# +# See Minitest.backtrace_filter=. +# +# pkg:gem/minitest#lib/minitest.rb:1190 +class Minitest::BacktraceFilter + # pkg:gem/minitest#lib/minitest.rb:1199 + def initialize(regexp = T.unsafe(nil)); end + + # Filter +bt+ to something useful. Returns the whole thing if + # $DEBUG (ruby) or $MT_DEBUG (env). + # + # pkg:gem/minitest#lib/minitest.rb:1207 + def filter(bt); end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # pkg:gem/minitest#lib/minitest.rb:1197 + def regexp; end + + # The regular expression to use to filter backtraces. Defaults to +MT_RE+. + # + # pkg:gem/minitest#lib/minitest.rb:1197 + def regexp=(_arg0); end +end + +# pkg:gem/minitest#lib/minitest.rb:1192 +Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp) + +# Dispatch to multiple reporters as one. +# +# pkg:gem/minitest#lib/minitest.rb:984 +class Minitest::CompositeReporter < ::Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:990 + def initialize(*reporters); end + + # Add another reporter to the mix. + # + # pkg:gem/minitest#lib/minitest.rb:1002 + def <<(reporter); end + + # pkg:gem/minitest#lib/minitest.rb:995 + def io; end + + # pkg:gem/minitest#lib/minitest.rb:1006 + def passed?; end + + # pkg:gem/minitest#lib/minitest.rb:1014 + def prerecord(klass, name); end + + # pkg:gem/minitest#lib/minitest.rb:1021 + def record(result); end + + # pkg:gem/minitest#lib/minitest.rb:1027 + def report; end + + # The list of reporters to dispatch to. + # + # pkg:gem/minitest#lib/minitest.rb:988 + def reporters; end + + # The list of reporters to dispatch to. + # + # pkg:gem/minitest#lib/minitest.rb:988 + def reporters=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:1010 + def start; end +end + +# Compresses backtraces. +# +# pkg:gem/minitest#lib/minitest/compress.rb:5 +module Minitest::Compress + # Takes a backtrace (array of strings) and compresses repeating + # cycles in it to make it more readable. + # + # pkg:gem/minitest#lib/minitest/compress.rb:11 + def compress(orig); end +end + +# Provides a simple set of guards that you can use in your tests +# to skip execution if it is not applicable. These methods are +# mixed into Test as both instance and class methods so you +# can use them inside or outside of the test methods. +# +# def test_something_for_mri +# skip "bug 1234" if jruby? +# # ... +# end +# +# if windows? then +# # ... lots of test methods ... +# end +# +# pkg:gem/minitest#lib/minitest.rb:1134 +module Minitest::Guard + # Is this running on jruby? + # + # pkg:gem/minitest#lib/minitest.rb:1139 + def jruby?(platform = T.unsafe(nil)); end + + # Is this running on maglev? + # + # pkg:gem/minitest#lib/minitest.rb:1146 + def maglev?(platform = T.unsafe(nil)); end + + # Is this running on mri? + # + # pkg:gem/minitest#lib/minitest.rb:1156 + def mri?(platform = T.unsafe(nil)); end + + # Is this running on macOS? + # + # pkg:gem/minitest#lib/minitest.rb:1163 + def osx?(platform = T.unsafe(nil)); end + + # Is this running on rubinius? + # + # pkg:gem/minitest#lib/minitest.rb:1170 + def rubinius?(platform = T.unsafe(nil)); end + + # Is this running on windows? + # + # pkg:gem/minitest#lib/minitest.rb:1180 + def windows?(platform = T.unsafe(nil)); end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:4 +module Minitest::Parallel; end + +# The engine used to run multiple tests in parallel. +# +# pkg:gem/minitest#lib/minitest/parallel.rb:9 +class Minitest::Parallel::Executor + # Create a parallel test executor of with +size+ workers. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:19 + def initialize(size); end + + # Add a job to the queue + # + # pkg:gem/minitest#lib/minitest/parallel.rb:45 + def <<(work); end + + # Shuts down the pool of workers by signalling them to quit and + # waiting for them all to finish what they're currently working + # on. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:52 + def shutdown; end + + # The size of the pool of workers. + # + # pkg:gem/minitest#lib/minitest/parallel.rb:14 + def size; end + + # Start the executor + # + # pkg:gem/minitest#lib/minitest/parallel.rb:28 + def start; end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:58 +module Minitest::Parallel::Test + # pkg:gem/minitest#lib/minitest/parallel.rb:59 + def _synchronize; end +end + +# pkg:gem/minitest#lib/minitest/parallel.rb:61 +module Minitest::Parallel::Test::ClassMethods + # pkg:gem/minitest#lib/minitest/parallel.rb:62 + def run_one_method(klass, method_name, reporter); end + + # pkg:gem/minitest#lib/minitest/parallel.rb:66 + def test_order; end +end + +# A very simple reporter that prints the "dots" during the run. +# +# This is added to the top-level CompositeReporter at the start of +# the run. If you want to change the output of minitest via a +# plugin, pull this out of the composite and replace it with your +# own. +# +# pkg:gem/minitest#lib/minitest.rb:774 +class Minitest::ProgressReporter < ::Minitest::Reporter + # pkg:gem/minitest#lib/minitest.rb:775 + def prerecord(klass, name); end + + # pkg:gem/minitest#lib/minitest.rb:782 + def record(result); end +end + +# Shared code for anything that can get passed to a Reporter. See +# Minitest::Test & Minitest::Result. +# +# pkg:gem/minitest#lib/minitest.rb:596 +module Minitest::Reportable + # pkg:gem/minitest#lib/minitest.rb:618 + def class_name; end + + # Did this run error? + # + # pkg:gem/minitest#lib/minitest.rb:639 + def error?; end + + # The location identifier of this test. Depends on a method + # existing called class_name. + # + # pkg:gem/minitest#lib/minitest.rb:613 + def location; end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # pkg:gem/minitest#lib/minitest.rb:603 + def passed?; end + + # Returns ".", "F", or "E" based on the result of the run. + # + # pkg:gem/minitest#lib/minitest.rb:625 + def result_code; end + + # Was this run skipped? + # + # pkg:gem/minitest#lib/minitest.rb:632 + def skipped?; end +end + +# pkg:gem/minitest#lib/minitest.rb:607 +Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String) + +# AbstractReportera +# +# pkg:gem/minitest#lib/minitest.rb:748 +class Minitest::Reporter < ::Minitest::AbstractReporter + # pkg:gem/minitest#lib/minitest.rb:759 + def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end + + # The IO used to report. + # + # pkg:gem/minitest#lib/minitest.rb:752 + def io; end + + # The IO used to report. + # + # pkg:gem/minitest#lib/minitest.rb:752 + def io=(_arg0); end + + # Command-line options for this run. + # + # pkg:gem/minitest#lib/minitest.rb:757 + def options; end + + # Command-line options for this run. + # + # pkg:gem/minitest#lib/minitest.rb:757 + def options=(_arg0); end +end + +# This represents a test result in a clean way that can be +# marshalled over a wire. Tests can do anything they want to the +# test instance and can create conditions that cause Marshal.dump to +# blow up. By using Result.from(a_test) you can be reasonably sure +# that the test result can be marshalled. +# +# pkg:gem/minitest#lib/minitest.rb:651 +class Minitest::Result < ::Minitest::Runnable + include ::Minitest::Reportable + + # pkg:gem/minitest#lib/minitest.rb:685 + def class_name; end + + # The class name of the test result. + # + # pkg:gem/minitest#lib/minitest.rb:660 + def klass; end + + # The class name of the test result. + # + # pkg:gem/minitest#lib/minitest.rb:660 + def klass=(_arg0); end + + # The location of the test method. + # + # pkg:gem/minitest#lib/minitest.rb:665 + def source_location; end + + # The location of the test method. + # + # pkg:gem/minitest#lib/minitest.rb:665 + def source_location=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:689 + def to_s; end + + class << self + # Create a new test result from a Runnable instance. + # + # pkg:gem/minitest#lib/minitest.rb:670 + def from(runnable); end + end +end + +# Represents anything "runnable", like Test, Spec, Benchmark, or +# whatever you can dream up. +# +# Subclasses of this are automatically registered and available in +# Runnable.runnables. +# +# pkg:gem/minitest#lib/minitest.rb:363 +class Minitest::Runnable + # pkg:gem/minitest#lib/minitest.rb:527 + def initialize(name); end + + # Number of assertions executed in this run. + # + # pkg:gem/minitest#lib/minitest.rb:367 + def assertions; end + + # Number of assertions executed in this run. + # + # pkg:gem/minitest#lib/minitest.rb:367 + def assertions=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:523 + def failure; end + + # An assertion raised during the run, if any. + # + # pkg:gem/minitest#lib/minitest.rb:372 + def failures; end + + # An assertion raised during the run, if any. + # + # pkg:gem/minitest#lib/minitest.rb:372 + def failures=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:509 + def marshal_dump; end + + # pkg:gem/minitest#lib/minitest.rb:519 + def marshal_load(ary); end + + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # Sets metadata, mainly used for +Result.from+. + # + # pkg:gem/minitest#lib/minitest.rb:542 + def metadata; end + + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # Sets metadata, mainly used for +Result.from+. + # + # pkg:gem/minitest#lib/minitest.rb:549 + def metadata=(_arg0); end + + # Returns true if metadata exists. + # + # pkg:gem/minitest#lib/minitest.rb:554 + def metadata?; end + + # Name of the run. + # + # pkg:gem/minitest#lib/minitest.rb:390 + def name; end + + # Set the name of the run. + # + # pkg:gem/minitest#lib/minitest.rb:397 + def name=(o); end + + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't + # cause the process to exit non-zero. + # + # pkg:gem/minitest#lib/minitest.rb:571 + def passed?; end + + # Returns a single character string to print based on the result + # of the run. One of ".", "F", + # "E" or "S". + # + # pkg:gem/minitest#lib/minitest.rb:580 + def result_code; end + + # Runs a single method. Needs to return self. + # + # pkg:gem/minitest#lib/minitest.rb:561 + def run; end + + # Was this run skipped? See #passed? for more information. + # + # pkg:gem/minitest#lib/minitest.rb:587 + def skipped?; end + + # The time it took to run. + # + # pkg:gem/minitest#lib/minitest.rb:377 + def time; end + + # The time it took to run. + # + # pkg:gem/minitest#lib/minitest.rb:377 + def time=(_arg0); end + + # pkg:gem/minitest#lib/minitest.rb:379 + def time_it; end + + class << self + # re-open + # + # pkg:gem/minitest#lib/minitest.rb:1241 + def inherited(klass); end + + # Returns all instance methods matching the pattern +re+. + # + # pkg:gem/minitest#lib/minitest.rb:404 + def methods_matching(re); end + + # pkg:gem/minitest#lib/minitest.rb:479 + def on_signal(name, action); end + + # pkg:gem/minitest#lib/minitest.rb:408 + def reset; end + + # Responsible for running all runnable methods in a given class, + # each in its own instance. Each instance is passed to the + # reporter to record. + # + # pkg:gem/minitest#lib/minitest.rb:419 + def run(reporter, options = T.unsafe(nil)); end + + # Runs a single method and has the reporter record the result. + # This was considered internal API but is factored out of run so + # that subclasses can specialize the running of an individual + # test. See Minitest::ParallelTest::ClassMethods for an example. + # + # pkg:gem/minitest#lib/minitest.rb:460 + def run_one_method(klass, method_name, reporter); end + + # Each subclass of Runnable is responsible for overriding this + # method to return all runnable methods. See #methods_matching. + # + # pkg:gem/minitest#lib/minitest.rb:496 + def runnable_methods; end + + # Returns all subclasses of Runnable. + # + # pkg:gem/minitest#lib/minitest.rb:503 + def runnables; end + + # Defines the order to run tests (:random by default). Override + # this or use a convenience method to change it for your tests. + # + # pkg:gem/minitest#lib/minitest.rb:469 + def test_order; end + + # pkg:gem/minitest#lib/minitest.rb:473 + def with_info_handler(reporter, &block); end + end +end + +# pkg:gem/minitest#lib/minitest.rb:477 +Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash) + +# Assertion raised when skipping a run. +# +# pkg:gem/minitest#lib/minitest.rb:1065 +class Minitest::Skip < ::Minitest::Assertion + # pkg:gem/minitest#lib/minitest.rb:1066 + def result_label; end +end + +# A reporter that gathers statistics about a test run. Does not do +# any IO because meant to be used as a parent class for a reporter +# that does. +# +# If you want to create an entirely different type of output (eg, +# CI, HTML, etc), this is the place to start. +# +# Example: +# +# class JenkinsCIReporter < StatisticsReporter +# def report +# super # Needed to calculate some statistics +# +# print "