graphql 2.5.19 → 2.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/graphql/dashboard/application_controller.rb +41 -0
- data/lib/graphql/dashboard/landings_controller.rb +9 -0
- data/lib/graphql/dashboard/statics_controller.rb +31 -0
- data/lib/graphql/dashboard/subscriptions.rb +2 -1
- data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +3 -3
- data/lib/graphql/dashboard.rb +9 -74
- data/lib/graphql/dataloader/null_dataloader.rb +7 -3
- data/lib/graphql/execution/multiplex.rb +1 -1
- data/lib/graphql/execution/next/field_resolve_step.rb +690 -0
- data/lib/graphql/execution/next/load_argument_step.rb +60 -0
- data/lib/graphql/execution/next/prepare_object_step.rb +129 -0
- data/lib/graphql/execution/next/runner.rb +389 -0
- data/lib/graphql/execution/next/selections_step.rb +37 -0
- data/lib/graphql/execution/next.rb +69 -0
- data/lib/graphql/execution.rb +1 -0
- data/lib/graphql/execution_error.rb +13 -10
- data/lib/graphql/introspection/directive_type.rb +7 -3
- data/lib/graphql/introspection/dynamic_fields.rb +5 -1
- data/lib/graphql/introspection/entry_points.rb +11 -3
- data/lib/graphql/introspection/enum_value_type.rb +5 -5
- data/lib/graphql/introspection/field_type.rb +13 -5
- data/lib/graphql/introspection/input_value_type.rb +21 -13
- data/lib/graphql/introspection/type_type.rb +64 -28
- data/lib/graphql/invalid_null_error.rb +11 -5
- data/lib/graphql/pagination/connection.rb +2 -0
- data/lib/graphql/pagination/connections.rb +32 -0
- data/lib/graphql/query/context.rb +3 -2
- data/lib/graphql/query/null_context.rb +9 -3
- data/lib/graphql/schema/argument.rb +5 -0
- data/lib/graphql/schema/build_from_definition.rb +7 -0
- data/lib/graphql/schema/field/connection_extension.rb +15 -35
- data/lib/graphql/schema/field/scope_extension.rb +22 -13
- data/lib/graphql/schema/field.rb +70 -1
- data/lib/graphql/schema/field_extension.rb +33 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +1 -1
- data/lib/graphql/schema/member/has_authorization.rb +35 -0
- data/lib/graphql/schema/member/has_dataloader.rb +17 -0
- data/lib/graphql/schema/member/has_fields.rb +5 -1
- data/lib/graphql/schema/member.rb +5 -0
- data/lib/graphql/schema/object.rb +1 -0
- data/lib/graphql/schema/resolver.rb +45 -1
- data/lib/graphql/schema/visibility.rb +1 -1
- data/lib/graphql/schema.rb +33 -7
- data/lib/graphql/subscriptions.rb +1 -1
- data/lib/graphql/tracing/perfetto_trace.rb +1 -1
- data/lib/graphql/types/relay/connection_behaviors.rb +8 -6
- data/lib/graphql/types/relay/edge_behaviors.rb +4 -3
- data/lib/graphql/types/relay/has_node_field.rb +13 -8
- data/lib/graphql/types/relay/has_nodes_field.rb +13 -8
- data/lib/graphql/types/relay/node_behaviors.rb +13 -2
- data/lib/graphql/unauthorized_error.rb +5 -1
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +3 -0
- metadata +12 -2
|
@@ -6,12 +6,13 @@ module GraphQL
|
|
|
6
6
|
module NodeBehaviors
|
|
7
7
|
def self.included(child_module)
|
|
8
8
|
child_module.extend(ClassMethods)
|
|
9
|
+
child_module.extend(ExecutionMethods)
|
|
9
10
|
child_module.description("An object with an ID.")
|
|
10
|
-
child_module.field(:id, ID, null: false, description: "ID of the object.", resolver_method: :default_global_id)
|
|
11
|
+
child_module.field(:id, ID, null: false, description: "ID of the object.", resolver_method: :default_global_id, resolve_each: :default_global_id)
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def default_global_id
|
|
14
|
-
|
|
15
|
+
self.class.default_global_id(object, context)
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
module ClassMethods
|
|
@@ -19,6 +20,16 @@ module GraphQL
|
|
|
19
20
|
true
|
|
20
21
|
end
|
|
21
22
|
end
|
|
23
|
+
|
|
24
|
+
module ExecutionMethods
|
|
25
|
+
def default_global_id(object, context)
|
|
26
|
+
context.schema.id_from_object(object, self, context)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def included(child_class)
|
|
30
|
+
child_class.extend(ExecutionMethods)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
22
33
|
end
|
|
23
34
|
end
|
|
24
35
|
end
|
|
@@ -4,7 +4,7 @@ module GraphQL
|
|
|
4
4
|
# It's passed to {Schema.unauthorized_object}.
|
|
5
5
|
#
|
|
6
6
|
# Alternatively, custom code in `authorized?` may raise this error. It will be routed the same way.
|
|
7
|
-
class UnauthorizedError < GraphQL::
|
|
7
|
+
class UnauthorizedError < GraphQL::RuntimeError
|
|
8
8
|
# @return [Object] the application object that failed the authorization check
|
|
9
9
|
attr_reader :object
|
|
10
10
|
|
|
@@ -19,11 +19,15 @@ module GraphQL
|
|
|
19
19
|
raise ArgumentError, "#{self.class.name} requires either a message or keywords"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
@path = nil
|
|
22
23
|
@object = object
|
|
23
24
|
@type = type
|
|
24
25
|
@context = context
|
|
26
|
+
@ast_nodes = nil
|
|
25
27
|
message ||= "An instance of #{object.class} failed #{type.graphql_name}'s authorization check"
|
|
26
28
|
super(message)
|
|
27
29
|
end
|
|
30
|
+
|
|
31
|
+
attr_accessor :path, :ast_nodes
|
|
28
32
|
end
|
|
29
33
|
end
|
data/lib/graphql/version.rb
CHANGED
data/lib/graphql.rb
CHANGED
|
@@ -21,6 +21,9 @@ module GraphQL
|
|
|
21
21
|
class Error < StandardError
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
class RuntimeError < Error
|
|
25
|
+
end
|
|
26
|
+
|
|
24
27
|
# This error is raised when GraphQL-Ruby encounters a situation
|
|
25
28
|
# that it *thought* would never happen. Please report this bug!
|
|
26
29
|
class InvariantError < Error
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.5.
|
|
4
|
+
version: 2.5.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Mosolgo
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-03-09 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|
|
@@ -448,8 +448,10 @@ files:
|
|
|
448
448
|
- lib/graphql/coercion_error.rb
|
|
449
449
|
- lib/graphql/current.rb
|
|
450
450
|
- lib/graphql/dashboard.rb
|
|
451
|
+
- lib/graphql/dashboard/application_controller.rb
|
|
451
452
|
- lib/graphql/dashboard/detailed_traces.rb
|
|
452
453
|
- lib/graphql/dashboard/installable.rb
|
|
454
|
+
- lib/graphql/dashboard/landings_controller.rb
|
|
453
455
|
- lib/graphql/dashboard/limiters.rb
|
|
454
456
|
- lib/graphql/dashboard/operation_store.rb
|
|
455
457
|
- lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css
|
|
@@ -459,6 +461,7 @@ files:
|
|
|
459
461
|
- lib/graphql/dashboard/statics/dashboard.js
|
|
460
462
|
- lib/graphql/dashboard/statics/header-icon.png
|
|
461
463
|
- lib/graphql/dashboard/statics/icon.png
|
|
464
|
+
- lib/graphql/dashboard/statics_controller.rb
|
|
462
465
|
- lib/graphql/dashboard/subscriptions.rb
|
|
463
466
|
- lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb
|
|
464
467
|
- lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb
|
|
@@ -503,6 +506,12 @@ files:
|
|
|
503
506
|
- lib/graphql/execution/lazy/lazy_method_map.rb
|
|
504
507
|
- lib/graphql/execution/lookahead.rb
|
|
505
508
|
- lib/graphql/execution/multiplex.rb
|
|
509
|
+
- lib/graphql/execution/next.rb
|
|
510
|
+
- lib/graphql/execution/next/field_resolve_step.rb
|
|
511
|
+
- lib/graphql/execution/next/load_argument_step.rb
|
|
512
|
+
- lib/graphql/execution/next/prepare_object_step.rb
|
|
513
|
+
- lib/graphql/execution/next/runner.rb
|
|
514
|
+
- lib/graphql/execution/next/selections_step.rb
|
|
506
515
|
- lib/graphql/execution_error.rb
|
|
507
516
|
- lib/graphql/integer_decoding_error.rb
|
|
508
517
|
- lib/graphql/integer_encoding_error.rb
|
|
@@ -608,6 +617,7 @@ files:
|
|
|
608
617
|
- lib/graphql/schema/member/graphql_type_names.rb
|
|
609
618
|
- lib/graphql/schema/member/has_arguments.rb
|
|
610
619
|
- lib/graphql/schema/member/has_ast_node.rb
|
|
620
|
+
- lib/graphql/schema/member/has_authorization.rb
|
|
611
621
|
- lib/graphql/schema/member/has_dataloader.rb
|
|
612
622
|
- lib/graphql/schema/member/has_deprecation_reason.rb
|
|
613
623
|
- lib/graphql/schema/member/has_directives.rb
|