repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/directive_checks.rb | lib/graphql/execution/directive_checks.rb | # frozen_string_literal: true
module GraphQL
module Execution
# Boolean checks for how an AST node's directives should
# influence its execution
# @api private
module DirectiveChecks
SKIP = "skip"
INCLUDE = "include"
module_function
# @return [Boolean] Should this node be inc... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/lazy.rb | lib/graphql/execution/lazy.rb | # frozen_string_literal: true
require "graphql/execution/lazy/lazy_method_map"
module GraphQL
module Execution
# 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-bi... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/multiplex.rb | lib/graphql/execution/multiplex.rb | # frozen_string_literal: true
module GraphQL
module Execution
# 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
#... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter.rb | lib/graphql/execution/interpreter.rb | # frozen_string_literal: true
require "fiber"
require "graphql/execution/interpreter/argument_value"
require "graphql/execution/interpreter/arguments"
require "graphql/execution/interpreter/arguments_cache"
require "graphql/execution/interpreter/execution_errors"
require "graphql/execution/interpreter/runtime"
require ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/lazy/lazy_method_map.rb | lib/graphql/execution/lazy/lazy_method_map.rb | # frozen_string_literal: true
require 'thread'
begin
require 'concurrent'
rescue LoadError
# no problem, we'll fallback to our own map
end
module GraphQL
module Execution
class Lazy
# {GraphQL::Schema} uses this to match returned values to lazy resolution methods.
# Methods may be registered for ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/arguments_cache.rb | lib/graphql/execution/interpreter/arguments_cache.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
class ArgumentsCache
def initialize(query)
@query = query
@dataloader = query.context.dataloader
@storage = Hash.new do |h, argument_owner|
h[argument_owner] = if argument_owner... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/resolve.rb | lib/graphql/execution/interpreter/resolve.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
module Resolve
# Continue field results in `results` until there's nothing else to continue.
# @return [void]
# @deprecated Call `dataloader.run` instead
def self.resolve_all(results, dataloader)... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/arguments.rb | lib/graphql/execution/interpreter/arguments.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
# 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... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/argument_value.rb | lib/graphql/execution/interpreter/argument_value.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
# A container for metadata regarding arguments present in a GraphQL query.
# @see Interpreter::Arguments#argument_values for a hash of these objects.
class ArgumentValue
def initialize(definition:, value:, o... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/handles_raw_value.rb | lib/graphql/execution/interpreter/handles_raw_value.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
# Wrapper for raw values
class RawValue
def initialize(obj = nil)
@object = obj
end
def resolve
@object
end
end
end
end
end
| ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/runtime.rb | lib/graphql/execution/interpreter/runtime.rb | # frozen_string_literal: true
require "graphql/execution/interpreter/runtime/graphql_result"
module GraphQL
module Execution
class Interpreter
# I think it would be even better if we could somehow make
# `continue_field` not recursive. "Trampolining" it somehow.
#
# @api private
cla... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | true |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/execution_errors.rb | lib/graphql/execution/interpreter/execution_errors.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
class ExecutionErrors
def initialize(ctx, ast_node, path)
@context = ctx
@ast_node = ast_node
@path = path
end
def add(err_or_msg)
err = case err_or_msg
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/execution/interpreter/runtime/graphql_result.rb | lib/graphql/execution/interpreter/runtime/graphql_result.rb | # frozen_string_literal: true
module GraphQL
module Execution
class Interpreter
class Runtime
module GraphQLResult
def initialize(result_name, result_type, application_value, parent_result, is_non_null_in_parent, selections, is_eager, ast_node, graphql_arguments, graphql_field) # rubocop:... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/query_depth.rb | lib/graphql/analysis/query_depth.rb | # frozen_string_literal: true
module GraphQL
module Analysis
# 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::QueryDep... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/query_complexity.rb | lib/graphql/analysis/query_complexity.rb | # frozen_string_literal: true
module GraphQL
module Analysis
# Calculate the complexity of a query, using {Field#complexity} values.
class QueryComplexity < Analyzer
# State for the query complexity calculation:
# - `complexities_on_type` holds complexity scores for each type
def initialize(... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/field_usage.rb | lib/graphql/analysis/field_usage.rb | # frozen_string_literal: true
module GraphQL
module Analysis
class FieldUsage < Analyzer
def initialize(query)
super
@used_fields = Set.new
@used_deprecated_fields = Set.new
@used_deprecated_arguments = Set.new
@used_deprecated_enum_values = Set.new
end
d... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/max_query_depth.rb | lib/graphql/analysis/max_query_depth.rb | # frozen_string_literal: true
module GraphQL
module Analysis
class MaxQueryDepth < QueryDepth
def result
configured_max_depth = if query
query.max_depth
else
multiplex.schema.max_depth
end
if configured_max_depth && @max_depth > configured_max_depth
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/max_query_complexity.rb | lib/graphql/analysis/max_query_complexity.rb | # frozen_string_literal: true
module GraphQL
module Analysis
# Used under the hood to implement complexity validation,
# see {Schema#max_complexity} and {Query#max_complexity}
class MaxQueryComplexity < QueryComplexity
def result
return if subject.max_complexity.nil?
total_complexit... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/analyzer.rb | lib/graphql/analysis/analyzer.rb | # frozen_string_literal: true
module GraphQL
module 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... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/analysis/visitor.rb | lib/graphql/analysis/visitor.rb | # frozen_string_literal: true
module GraphQL
module Analysis
# 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 suc... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/iso_8601_date.rb | lib/graphql/types/iso_8601_date.rb | # frozen_string_literal: true
module GraphQL
module Types
# 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_a... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/iso_8601_date_time.rb | lib/graphql/types/iso_8601_date_time.rb | # frozen_string_literal: true
require 'time'
module GraphQL
module Types
# 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
#
# ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/int.rb | lib/graphql/types/int.rb | # frozen_string_literal: true
module GraphQL
module Types
# @see {Types::BigInt} for handling integers outside 32-bit range.
class Int < GraphQL::Schema::Scalar
description "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1."
MIN = -(2**... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/id.rb | lib/graphql/types/id.rb | # frozen_string_literal: true
module GraphQL
module Types
class ID < GraphQL::Schema::Scalar
graphql_name "ID"
description "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay.rb | lib/graphql/types/relay.rb | # frozen_string_literal: true
# behavior modules:
require "graphql/types/relay/connection_behaviors"
require "graphql/types/relay/edge_behaviors"
require "graphql/types/relay/node_behaviors"
require "graphql/types/relay/page_info_behaviors"
require "graphql/types/relay/has_node_field"
require "graphql/types/relay/has_... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/float.rb | lib/graphql/types/float.rb | # frozen_string_literal: true
module GraphQL
module Types
class Float < GraphQL::Schema::Scalar
description "Represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point)."
def self.coerce_input(value, _ctx)
value.is_a?(Num... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/boolean.rb | lib/graphql/types/boolean.rb | # frozen_string_literal: true
module GraphQL
module Types
class Boolean < GraphQL::Schema::Scalar
description "Represents `true` or `false` values."
def self.coerce_input(value, _ctx)
(value == true || value == false) ? value : nil
end
def self.coerce_result(value, _ctx)
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/json.rb | lib/graphql/types/json.rb | # frozen_string_literal: true
module GraphQL
module Types
# 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:
#
# ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/iso_8601_duration.rb | lib/graphql/types/iso_8601_duration.rb | # frozen_string_literal: true
module GraphQL
module Types
# 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::ISO... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/string.rb | lib/graphql/types/string.rb | # frozen_string_literal: true
module GraphQL
module Types
class String < GraphQL::Schema::Scalar
description "Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text."
def self.coerce_result(value, ctx)
str = va... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/big_int.rb | lib/graphql/types/big_int.rb | # frozen_string_literal: true
module GraphQL
module Types
class BigInt < GraphQL::Schema::Scalar
description "Represents non-fractional signed whole numeric values. Since the value may exceed the size of a 32-bit integer, it's encoded as a string."
def self.coerce_input(value, _ctx)
value &&... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/connection_behaviors.rb | lib/graphql/types/relay/connection_behaviors.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
module ConnectionBehaviors
extend Forwardable
def_delegators :@object, :cursor_from_node, :parent
def self.included(child_class)
child_class.extend(ClassMethods)
child_class.has_nodes_field(t... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/has_node_field.rb | lib/graphql/types/relay/has_node_field.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# 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.
module HasNodeField
def self.included(child_class)
child_class.fiel... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/base_edge.rb | lib/graphql/types/relay/base_edge.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# 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... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/page_info.rb | lib/graphql/types/relay/page_info.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# The return type of a connection's `pageInfo` field
class PageInfo < GraphQL::Schema::Object
include PageInfoBehaviors
end
end
end
end
| ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/edge_behaviors.rb | lib/graphql/types/relay/edge_behaviors.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
module EdgeBehaviors
def self.included(child_class)
child_class.description("An edge in a connection.")
child_class.field(:cursor, String, null: false, description: "A cursor for use in pagination.")
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/node.rb | lib/graphql/types/relay/node.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# This can be used for Relay's `Node` interface,
# or you can take it as inspiration for your own implementation
# of the `Node` interface.
module Node
include GraphQL::Schema::Interface
include Types::... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/node_behaviors.rb | lib/graphql/types/relay/node_behaviors.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
module NodeBehaviors
def self.included(child_module)
child_module.extend(ClassMethods)
child_module.description("An object with an ID.")
child_module.field(:id, ID, null: false, description: "ID of ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/base_connection.rb | lib/graphql/types/relay/base_connection.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# 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` ins... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/has_nodes_field.rb | lib/graphql/types/relay/has_nodes_field.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
# 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.
module HasNodesField
def self.included(child_class)
child_class.fiel... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/types/relay/page_info_behaviors.rb | lib/graphql/types/relay/page_info_behaviors.rb | # frozen_string_literal: true
module GraphQL
module Types
module Relay
module PageInfoBehaviors
def self.included(child_class)
child_class.extend ClassMethods
child_class.description "Information about pagination in a connection."
child_class.field :has_next_page, Boole... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/dashboard/limiters.rb | lib/graphql/dashboard/limiters.rb | # frozen_string_literal: true
require_relative "./installable"
module Graphql
class Dashboard < Rails::Engine
module Limiters
class LimitersController < Dashboard::ApplicationController
include Installable
FALLBACK_CSP_NONCE_GENERATOR = ->(_req) { SecureRandom.hex(32) }
def show
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/dashboard/installable.rb | lib/graphql/dashboard/installable.rb | # frozen_string_literal: true
module Graphql
class Dashboard < Rails::Engine
module Installable
def self.included(child_module)
child_module.before_action(:check_installed)
end
def feature_installed?
raise "Implement #{self.class}#feature_installed? to check whether this should ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/dashboard/operation_store.rb | lib/graphql/dashboard/operation_store.rb | # frozen_string_literal: true
require_relative "./installable"
module Graphql
class Dashboard < Rails::Engine
module OperationStore
class BaseController < Dashboard::ApplicationController
include Installable
private
def feature_installed?
schema_class.respond_to?(:operati... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/dashboard/detailed_traces.rb | lib/graphql/dashboard/detailed_traces.rb | # frozen_string_literal: true
require_relative "./installable"
module Graphql
class Dashboard < Rails::Engine
module DetailedTraces
class TracesController < Graphql::Dashboard::ApplicationController
include Installable
def index
@last = params[:last]&.to_i || 50
@before ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/dashboard/subscriptions.rb | lib/graphql/dashboard/subscriptions.rb | # frozen_string_literal: true
module Graphql
class Dashboard < Rails::Engine
module Subscriptions
class BaseController < Graphql::Dashboard::ApplicationController
include Installable
def feature_installed?
schema_class.subscriptions.is_a?(GraphQL::Pro::Subscriptions)
end
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/mongoid_relation_connection.rb | lib/graphql/pagination/mongoid_relation_connection.rb | # frozen_string_literal: true
require "graphql/pagination/relation_connection"
module GraphQL
module Pagination
class MongoidRelationConnection < Pagination::RelationConnection
def relation_offset(relation)
relation.options.skip
end
def relation_limit(relation)
relation.options... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/sequel_dataset_connection.rb | lib/graphql/pagination/sequel_dataset_connection.rb | # frozen_string_literal: true
require "graphql/pagination/relation_connection"
module GraphQL
module Pagination
# Customizes `RelationConnection` to work with `Sequel::Dataset`s.
class SequelDatasetConnection < Pagination::RelationConnection
private
def relation_offset(relation)
relation... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/array_connection.rb | lib/graphql/pagination/array_connection.rb | # frozen_string_literal: true
require "graphql/pagination/connection"
module GraphQL
module Pagination
class ArrayConnection < Pagination::Connection
def nodes
load_nodes
@nodes
end
def has_previous_page
load_nodes
@has_previous_page
end
def has_nex... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/relation_connection.rb | lib/graphql/pagination/relation_connection.rb | # frozen_string_literal: true
require "graphql/pagination/connection"
module GraphQL
module Pagination
# A generic class for working with database query objects.
class RelationConnection < Pagination::Connection
def nodes
load_nodes
@nodes
end
def has_previous_page
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/connection.rb | lib/graphql/pagination/connection.rb | # frozen_string_literal: true
module GraphQL
module Pagination
# 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 connect... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/connections.rb | lib/graphql/pagination/connections.rb | # frozen_string_literal: true
module GraphQL
module Pagination
# 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)
# ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/pagination/active_record_relation_connection.rb | lib/graphql/pagination/active_record_relation_connection.rb | # frozen_string_literal: true
require "graphql/pagination/relation_connection"
module GraphQL
module Pagination
# Customizes `RelationConnection` to work with `ActiveRecord::Relation`s.
class ActiveRecordRelationConnection < Pagination::RelationConnection
private
def relation_count(relation)
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/testing/helpers.rb | lib/graphql/testing/helpers.rb | # frozen_string_literal: true
module GraphQL
module Testing
module Helpers
# @param schema_class [Class<GraphQL::Schema>]
# @return [Module] A helpers module which always uses the given schema
def self.for(schema_class)
SchemaHelpers.for(schema_class)
end
class Error < Graph... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/testing/mock_action_cable.rb | lib/graphql/testing/mock_action_cable.rb | # frozen_string_literal: true
module GraphQL
module Testing
# 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
# ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/rake_task/validate.rb | lib/graphql/rake_task/validate.rb | # frozen_string_literal: true
module GraphQL
class RakeTask
extend Rake::DSL
desc "Get the checksum of a graphql-pro version and compare it to published versions on GitHub and graphql-ruby.org"
task "graphql:pro:validate", [:gem_version] do |t, args|
version = args[:gem_version]
if version.n... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/backtrace/table.rb | lib/graphql/backtrace/table.rb | # frozen_string_literal: true
module GraphQL
class Backtrace
# A class for turning a context into a human-readable table or array
class Table
MIN_COL_WIDTH = 4
MAX_COL_WIDTH = 100
HEADERS = [
"Loc",
"Field",
"Object",
"Arguments",
"Result",
]
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/backtrace/traced_error.rb | lib/graphql/backtrace/traced_error.rb | # frozen_string_literal: true
module GraphQL
class Backtrace
# When {Backtrace} is enabled, raised errors are wrapped with {TracedError}.
class TracedError < GraphQL::Error
# @return [Array<String>] Printable backtrace of GraphQL error context
attr_reader :graphql_backtrace
# @return [Graph... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/definition_slice.rb | lib/graphql/language/definition_slice.rb | # frozen_string_literal: true
module GraphQL
module Language
module DefinitionSlice
extend self
def slice(document, name)
definitions = {}
document.definitions.each { |d| definitions[d.name] = d }
names = Set.new
DependencyVisitor.find_definition_dependencies(definitio... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/static_visitor.rb | lib/graphql/language/static_visitor.rb | # frozen_string_literal: true
module GraphQL
module Language
# Like `GraphQL::Language::Visitor` except it doesn't support
# making changes to the document -- only visiting it as-is.
class StaticVisitor
def initialize(document)
@document = document
end
# Visit `document` and all... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/nodes.rb | lib/graphql/language/nodes.rb | # frozen_string_literal: true
module GraphQL
module Language
module Nodes
NONE = GraphQL::EmptyObjects::EMPTY_ARRAY
# {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 thi... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/block_string.rb | lib/graphql/language/block_string.rb | # frozen_string_literal: true
module GraphQL
module Language
module BlockString
# 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
def self.trim_whitespace(str)
# Early... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/parser.rb | lib/graphql/language/parser.rb | # frozen_string_literal: true
require "strscan"
require "graphql/language/nodes"
require "graphql/tracing/null_trace"
module GraphQL
module Language
class Parser
include GraphQL::Language::Nodes
include EmptyObjects
class << self
attr_accessor :cache
def parse(graphql_str, fi... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/sanitized_printer.rb | lib/graphql/language/sanitized_printer.rb | # frozen_string_literal: true
module GraphQL
module Language
# 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 AS... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/document_from_schema_definition.rb | lib/graphql/language/document_from_schema_definition.rb | # frozen_string_literal: true
module GraphQL
module Language
# @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)>]
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/comment.rb | lib/graphql/language/comment.rb | # frozen_string_literal: true
module GraphQL
module Language
module Comment
def self.print(str, indent: '')
lines = str.split("\n").map do |line|
comment_str = "".dup
comment_str << indent
comment_str << "# "
comment_str << line
comment_str.rstrip
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/lexer.rb | lib/graphql/language/lexer.rb | # frozen_string_literal: true
module GraphQL
module Language
class Lexer
def initialize(graphql_str, filename: nil, max_tokens: nil)
if !(graphql_str.encoding == Encoding::UTF_8 || graphql_str.ascii_only?)
graphql_str = graphql_str.dup.force_encoding(Encoding::UTF_8)
end
@... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/printer.rb | lib/graphql/language/printer.rb | # frozen_string_literal: true
module GraphQL
module Language
class Printer
OMISSION = "... (truncated)"
class TruncatableBuffer
class TruncateSizeReached < StandardError; end
DEFAULT_INIT_CAPACITY = 500
def initialize(truncate_size: nil)
@out = String.new(capacity:... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/visitor.rb | lib/graphql/language/visitor.rb | # frozen_string_literal: true
module GraphQL
module Language
# 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)
# su... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/generation.rb | lib/graphql/language/generation.rb | # frozen_string_literal: true
module GraphQL
module Language
# Exposes {.generate}, which turns AST nodes back into query strings.
module Generation
extend self
# Turn an AST node back into a string.
#
# @example Turning a document into a query
# document = GraphQL.parse(quer... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/language/cache.rb | lib/graphql/language/cache.rb | # frozen_string_literal: true
require 'graphql/version'
require 'digest/sha2'
module GraphQL
module Language
# 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 applicat... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/warden.rb | lib/graphql/schema/warden.rb | # frozen_string_literal: true
require 'set'
module GraphQL
class Schema
# 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,
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/unique_within_type.rb | lib/graphql/schema/unique_within_type.rb | # frozen_string_literal: true
require "base64"
module GraphQL
class Schema
module UniqueWithinType
class << self
attr_accessor :default_id_separator
end
self.default_id_separator = "-"
module_function
# @param type_name [String]
# @param object_value [Any]
# @r... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/subscription.rb | lib/graphql/schema/subscription.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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
# - `... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/mutation.rb | lib/graphql/schema/mutation.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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 `gener... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/member.rb | lib/graphql/schema/member.rb | # frozen_string_literal: true
require 'graphql/schema/member/base_dsl_methods'
require 'graphql/schema/member/graphql_type_names'
require 'graphql/schema/member/has_ast_node'
require 'graphql/schema/member/has_dataloader'
require 'graphql/schema/member/has_directives'
require 'graphql/schema/member/has_deprecation_reas... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/non_null.rb | lib/graphql/schema/non_null.rb | # frozen_string_literal: true
module GraphQL
class Schema
# Represents a non null type in the schema.
# Wraps a {Schema::Member} when it is required.
# @see {Schema::Member::TypeSystemHelpers#to_non_null_type}
class NonNull < GraphQL::Schema::Wrapper
include Schema::Member::ValidatesInput
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/timeout.rb | lib/graphql/schema/timeout.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/find_inherited_value.rb | lib/graphql/schema/find_inherited_value.rb | # frozen_string_literal: true
module GraphQL
class Schema
module FindInheritedValue
def self.extended(child_cls)
child_cls.singleton_class.include(GraphQL::EmptyObjects)
end
def self.included(child_cls)
child_cls.include(GraphQL::EmptyObjects)
end
private
def... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/interface.rb | lib/graphql/schema/interface.rb | # frozen_string_literal: true
module GraphQL
class Schema
module Interface
include GraphQL::Schema::Member::GraphQLTypeNames
module DefinitionMethods
include GraphQL::Schema::Member::BaseDSLMethods
# ConfigurationExtension's responsibilities are in `def included` below
include ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/introspection_system.rb | lib/graphql/schema/introspection_system.rb | # frozen_string_literal: true
module GraphQL
class Schema
class IntrospectionSystem
attr_reader :types, :possible_types
def initialize(schema)
@schema = schema
@class_based = !!@schema.is_a?(Class)
@built_in_namespace = GraphQL::Introspection
@custom_namespace = if @cl... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/field.rb | lib/graphql/schema/field.rb | # frozen_string_literal: true
require "graphql/schema/field/connection_extension"
require "graphql/schema/field/scope_extension"
module GraphQL
class Schema
class Field
include GraphQL::Schema::Member::HasArguments
include GraphQL::Schema::Member::HasArguments::FieldConfigured
include GraphQL::... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | true |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/visibility.rb | lib/graphql/schema/visibility.rb | # frozen_string_literal: true
require "graphql/schema/visibility/profile"
require "graphql/schema/visibility/migration"
require "graphql/schema/visibility/visit"
module GraphQL
class Schema
# Use this plugin to make some parts of your schema hidden from some viewers.
#
class Visibility
# @param sch... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/built_in_types.rb | lib/graphql/schema/built_in_types.rb | # frozen_string_literal: true
module GraphQL
class Schema
BUILT_IN_TYPES = {
"Int" => GraphQL::Types::Int,
"String" => GraphQL::Types::String,
"Float" => GraphQL::Types::Float,
"Boolean" => GraphQL::Types::Boolean,
"ID" => GraphQL::Types::ID,
}
end
end
| ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/loader.rb | lib/graphql/schema/loader.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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 qu... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/ractor_shareable.rb | lib/graphql/schema/ractor_shareable.rb | # frozen_string_literal: true
module GraphQL
class Schema
module RactorShareable
def self.extended(schema_class)
schema_class.extend(SchemaExtension)
schema_class.freeze_schema
end
module SchemaExtension
def freeze_error_handlers(handlers)
handlers[:subclass_h... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/finder.rb | lib/graphql/schema/finder.rb | # frozen_string_literal: true
module GraphQL
class Schema
# Find schema members using string paths
#
# @example Finding object types
# MySchema.find("SomeObjectType")
#
# @example Finding fields
# MySchema.find("SomeObjectType.myField")
#
# @example Finding arguments
# M... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/build_from_definition.rb | lib/graphql/schema/build_from_definition.rb | # frozen_string_literal: true
require "graphql/schema/build_from_definition/resolve_map"
module GraphQL
class Schema
module BuildFromDefinition
class << self
# @see {Schema.from_definition}
def from_definition(schema_superclass, definition_string, parser: GraphQL.default_parser, **kwargs)
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/resolver.rb | lib/graphql/schema/resolver.rb | # frozen_string_literal: true
require "graphql/schema/resolver/has_payload_type"
module GraphQL
class Schema
# 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 `.ty... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/validator.rb | lib/graphql/schema/validator.rb | # frozen_string_literal: true
module GraphQL
class Schema
class Validator
# The thing being validated
# @return [GraphQL::Schema::Argument, GraphQL::Schema::Field, GraphQL::Schema::Resolver, Class<GraphQL::Schema::InputObject>]
attr_reader :validated
# @param validated [GraphQL::Schema::... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/object.rb | lib/graphql/schema/object.rb | # frozen_string_literal: true
require "graphql/query/null_context"
module GraphQL
class Schema
class Object < GraphQL::Schema::Member
extend GraphQL::Schema::Member::HasFields
extend GraphQL::Schema::Member::HasInterfaces
include Member::HasDataloader
# Raised when an Object doesn't hav... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/union.rb | lib/graphql/schema/union.rb | # frozen_string_literal: true
module GraphQL
class Schema
class Union < GraphQL::Schema::Member
extend GraphQL::Schema::Member::HasUnresolvedTypeError
class << self
def inherited(child_class)
add_unresolved_type_error(child_class)
super
end
def possible_ty... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/addition.rb | lib/graphql/schema/addition.rb | # frozen_string_literal: true
module GraphQL
class Schema
class Addition
attr_reader :directives, :possible_types, :types, :union_memberships, :references, :arguments_with_default_values
def initialize(schema:, own_types:, new_types:)
@schema = schema
@own_types = own_types
@... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/type_membership.rb | lib/graphql/schema/type_membership.rb | # frozen_string_literal: true
module GraphQL
class Schema
# This class joins an object type to an abstract type (interface or union) of which
# it is a member.
class TypeMembership
# @return [Class<GraphQL::Schema::Object>]
attr_accessor :object_type
# @return [Class<GraphQL::Schema::U... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/enum.rb | lib/graphql/schema/enum.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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
# ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/directive.rb | lib/graphql/schema/directive.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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 ... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/list.rb | lib/graphql/schema/list.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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
class List < GraphQL::Schema::Wrapper
include Schema::M... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/field_extension.rb | lib/graphql/schema/field_extension.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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.
... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/printer.rb | lib/graphql/schema/printer.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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 outpu... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby/blob/fa2ba4e489f8475b194f7c6985e0b25681a442c2/lib/graphql/schema/enum_value.rb | lib/graphql/schema/enum_value.rb | # frozen_string_literal: true
module GraphQL
class Schema
# 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
#... | ruby | MIT | fa2ba4e489f8475b194f7c6985e0b25681a442c2 | 2026-01-04T15:43:02.089024Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.