graphql 2.0.27 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/graphql/install/templates/base_mutation.erb +2 -0
- data/lib/generators/graphql/install/templates/mutation_type.erb +2 -0
- data/lib/generators/graphql/install_generator.rb +3 -0
- data/lib/generators/graphql/templates/base_argument.erb +2 -0
- data/lib/generators/graphql/templates/base_connection.erb +2 -0
- data/lib/generators/graphql/templates/base_edge.erb +2 -0
- data/lib/generators/graphql/templates/base_enum.erb +2 -0
- data/lib/generators/graphql/templates/base_field.erb +2 -0
- data/lib/generators/graphql/templates/base_input_object.erb +2 -0
- data/lib/generators/graphql/templates/base_interface.erb +2 -0
- data/lib/generators/graphql/templates/base_object.erb +2 -0
- data/lib/generators/graphql/templates/base_resolver.erb +6 -0
- data/lib/generators/graphql/templates/base_scalar.erb +2 -0
- data/lib/generators/graphql/templates/base_union.erb +2 -0
- data/lib/generators/graphql/templates/graphql_controller.erb +2 -0
- data/lib/generators/graphql/templates/loader.erb +2 -0
- data/lib/generators/graphql/templates/mutation.erb +2 -0
- data/lib/generators/graphql/templates/node_type.erb +2 -0
- data/lib/generators/graphql/templates/query_type.erb +2 -0
- data/lib/generators/graphql/templates/schema.erb +2 -0
- data/lib/graphql/analysis/ast/analyzer.rb +7 -0
- data/lib/graphql/analysis/ast/field_usage.rb +32 -7
- data/lib/graphql/analysis/ast/query_complexity.rb +80 -128
- data/lib/graphql/analysis/ast/query_depth.rb +7 -2
- data/lib/graphql/analysis/ast/visitor.rb +2 -2
- data/lib/graphql/analysis/ast.rb +21 -11
- data/lib/graphql/backtrace/trace.rb +12 -15
- data/lib/graphql/coercion_error.rb +1 -9
- data/lib/graphql/dataloader/async_dataloader.rb +85 -0
- data/lib/graphql/dataloader/source.rb +11 -3
- data/lib/graphql/dataloader.rb +109 -142
- data/lib/graphql/duration_encoding_error.rb +16 -0
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +170 -0
- data/lib/graphql/execution/interpreter/runtime.rb +70 -248
- data/lib/graphql/execution/interpreter.rb +91 -157
- data/lib/graphql/execution/lookahead.rb +88 -21
- data/lib/graphql/introspection/dynamic_fields.rb +1 -1
- data/lib/graphql/introspection/entry_points.rb +11 -5
- data/lib/graphql/introspection/schema_type.rb +3 -1
- data/lib/graphql/language/block_string.rb +34 -18
- data/lib/graphql/language/definition_slice.rb +1 -1
- data/lib/graphql/language/document_from_schema_definition.rb +37 -37
- data/lib/graphql/language/lexer.rb +271 -177
- data/lib/graphql/language/nodes.rb +74 -56
- data/lib/graphql/language/parser.rb +697 -1986
- data/lib/graphql/language/printer.rb +299 -146
- data/lib/graphql/language/sanitized_printer.rb +20 -22
- data/lib/graphql/language/static_visitor.rb +167 -0
- data/lib/graphql/language/visitor.rb +20 -81
- data/lib/graphql/language.rb +1 -0
- data/lib/graphql/load_application_object_failed_error.rb +5 -1
- data/lib/graphql/pagination/array_connection.rb +3 -3
- data/lib/graphql/pagination/connection.rb +28 -1
- data/lib/graphql/pagination/mongoid_relation_connection.rb +1 -2
- data/lib/graphql/pagination/relation_connection.rb +3 -3
- data/lib/graphql/query/context/scoped_context.rb +101 -0
- data/lib/graphql/query/context.rb +36 -98
- data/lib/graphql/query/null_context.rb +4 -11
- data/lib/graphql/query/validation_pipeline.rb +2 -2
- data/lib/graphql/query/variables.rb +3 -3
- data/lib/graphql/query.rb +13 -22
- data/lib/graphql/railtie.rb +9 -6
- data/lib/graphql/rake_task.rb +3 -12
- data/lib/graphql/schema/argument.rb +6 -1
- data/lib/graphql/schema/build_from_definition.rb +0 -11
- data/lib/graphql/schema/directive/one_of.rb +12 -0
- data/lib/graphql/schema/directive/specified_by.rb +14 -0
- data/lib/graphql/schema/directive.rb +1 -1
- data/lib/graphql/schema/enum.rb +3 -3
- data/lib/graphql/schema/field/connection_extension.rb +1 -15
- data/lib/graphql/schema/field/scope_extension.rb +8 -1
- data/lib/graphql/schema/field.rb +8 -5
- data/lib/graphql/schema/has_single_input_argument.rb +156 -0
- data/lib/graphql/schema/input_object.rb +2 -2
- data/lib/graphql/schema/interface.rb +10 -10
- data/lib/graphql/schema/introspection_system.rb +2 -0
- data/lib/graphql/schema/loader.rb +0 -2
- data/lib/graphql/schema/member/base_dsl_methods.rb +2 -1
- data/lib/graphql/schema/member/has_arguments.rb +61 -38
- data/lib/graphql/schema/member/has_fields.rb +8 -5
- data/lib/graphql/schema/member/has_interfaces.rb +23 -9
- data/lib/graphql/schema/member/scoped.rb +19 -0
- data/lib/graphql/schema/member/validates_input.rb +3 -3
- data/lib/graphql/schema/object.rb +8 -0
- data/lib/graphql/schema/printer.rb +8 -7
- data/lib/graphql/schema/relay_classic_mutation.rb +6 -128
- data/lib/graphql/schema/resolver.rb +7 -3
- data/lib/graphql/schema/scalar.rb +3 -3
- data/lib/graphql/schema/subscription.rb +11 -4
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/warden.rb +96 -94
- data/lib/graphql/schema.rb +219 -72
- data/lib/graphql/static_validation/all_rules.rb +1 -1
- data/lib/graphql/static_validation/base_visitor.rb +1 -1
- data/lib/graphql/static_validation/literal_validator.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +1 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +1 -1
- data/lib/graphql/static_validation/validation_context.rb +5 -5
- data/lib/graphql/static_validation/validator.rb +3 -0
- data/lib/graphql/static_validation.rb +0 -1
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +3 -2
- data/lib/graphql/subscriptions/event.rb +8 -2
- data/lib/graphql/subscriptions.rb +14 -12
- data/lib/graphql/testing/helpers.rb +125 -0
- data/lib/graphql/testing.rb +2 -0
- data/lib/graphql/tracing/appoptics_trace.rb +2 -2
- data/lib/graphql/tracing/appoptics_tracing.rb +2 -2
- data/lib/graphql/tracing/data_dog_trace.rb +21 -34
- data/lib/graphql/tracing/data_dog_tracing.rb +7 -21
- data/lib/graphql/tracing/legacy_hooks_trace.rb +74 -0
- data/lib/graphql/tracing/platform_tracing.rb +2 -0
- data/lib/graphql/tracing/{prometheus_tracing → prometheus_trace}/graphql_collector.rb +3 -1
- data/lib/graphql/tracing/sentry_trace.rb +94 -0
- data/lib/graphql/tracing/trace.rb +1 -0
- data/lib/graphql/tracing.rb +3 -1
- data/lib/graphql/types/iso_8601_duration.rb +77 -0
- data/lib/graphql/types/relay/connection_behaviors.rb +32 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +7 -0
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +3 -3
- data/readme.md +12 -2
- metadata +33 -25
- data/lib/graphql/deprecation.rb +0 -9
- data/lib/graphql/filter.rb +0 -59
- data/lib/graphql/language/parser.y +0 -560
- data/lib/graphql/static_validation/type_stack.rb +0 -216
- data/lib/graphql/subscriptions/instrumentation.rb +0 -28
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module GraphQL
|
3
|
+
module Types
|
4
|
+
# This scalar takes `Duration`s and transmits them as strings,
|
5
|
+
# using ISO 8601 format. ActiveSupport >= 5.0 must be loaded to use
|
6
|
+
# this scalar.
|
7
|
+
#
|
8
|
+
# Use it for fields or arguments as follows:
|
9
|
+
#
|
10
|
+
# field :age, GraphQL::Types::ISO8601Duration, null: false
|
11
|
+
#
|
12
|
+
# argument :interval, GraphQL::Types::ISO8601Duration, null: false
|
13
|
+
#
|
14
|
+
# Alternatively, use this built-in scalar as inspiration for your
|
15
|
+
# own Duration type.
|
16
|
+
class ISO8601Duration < GraphQL::Schema::Scalar
|
17
|
+
description "An ISO 8601-encoded duration"
|
18
|
+
|
19
|
+
# @return [Integer, nil]
|
20
|
+
def self.seconds_precision
|
21
|
+
# ActiveSupport::Duration precision defaults to whatever input was given
|
22
|
+
@seconds_precision
|
23
|
+
end
|
24
|
+
|
25
|
+
# @param [Integer, nil] value
|
26
|
+
def self.seconds_precision=(value)
|
27
|
+
@seconds_precision = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param value [ActiveSupport::Duration, String]
|
31
|
+
# @return [String]
|
32
|
+
# @raise [GraphQL::Error] if ActiveSupport::Duration is not defined or if an incompatible object is passed
|
33
|
+
def self.coerce_result(value, _ctx)
|
34
|
+
unless defined?(ActiveSupport::Duration)
|
35
|
+
raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
|
36
|
+
end
|
37
|
+
|
38
|
+
begin
|
39
|
+
case value
|
40
|
+
when ActiveSupport::Duration
|
41
|
+
value.iso8601(precision: seconds_precision)
|
42
|
+
when ::String
|
43
|
+
ActiveSupport::Duration.parse(value).iso8601(precision: seconds_precision)
|
44
|
+
else
|
45
|
+
# Try calling as ActiveSupport::Duration compatible as a fallback
|
46
|
+
value.iso8601(precision: seconds_precision)
|
47
|
+
end
|
48
|
+
rescue StandardError => error
|
49
|
+
raise GraphQL::Error, "An incompatible object (#{value.class}) was given to #{self}. Make sure that only ActiveSupport::Durations and well-formatted Strings are used with this type. (#{error.message})"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# @param value [String, ActiveSupport::Duration]
|
54
|
+
# @return [ActiveSupport::Duration, nil]
|
55
|
+
# @raise [GraphQL::Error] if ActiveSupport::Duration is not defined
|
56
|
+
# @raise [GraphQL::DurationEncodingError] if duration cannot be parsed
|
57
|
+
def self.coerce_input(value, ctx)
|
58
|
+
unless defined?(ActiveSupport::Duration)
|
59
|
+
raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
|
60
|
+
end
|
61
|
+
|
62
|
+
begin
|
63
|
+
if value.is_a?(ActiveSupport::Duration)
|
64
|
+
value
|
65
|
+
elsif value.nil?
|
66
|
+
nil
|
67
|
+
else
|
68
|
+
ActiveSupport::Duration.parse(value)
|
69
|
+
end
|
70
|
+
rescue ArgumentError, TypeError
|
71
|
+
err = GraphQL::DurationEncodingError.new(value)
|
72
|
+
ctx.schema.type_error(err, ctx)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -67,9 +67,8 @@ module GraphQL
|
|
67
67
|
type: [edge_type_class, null: edge_nullable],
|
68
68
|
null: edges_nullable,
|
69
69
|
description: "A list of edges.",
|
70
|
+
scope: false, # Assume that the connection was already scoped.
|
70
71
|
connection: false,
|
71
|
-
# Assume that the connection was scoped before this step:
|
72
|
-
scope: false,
|
73
72
|
}
|
74
73
|
|
75
74
|
if field_options
|
@@ -88,6 +87,19 @@ module GraphQL
|
|
88
87
|
node_type.scope_items(items, context)
|
89
88
|
end
|
90
89
|
|
90
|
+
# The connection will skip auth on its nodes if the node_type is configured for that
|
91
|
+
def reauthorize_scoped_objects(new_value = nil)
|
92
|
+
if new_value.nil?
|
93
|
+
if @reauthorize_scoped_objects != nil
|
94
|
+
@reauthorize_scoped_objects
|
95
|
+
else
|
96
|
+
node_type.reauthorize_scoped_objects
|
97
|
+
end
|
98
|
+
else
|
99
|
+
@reauthorize_scoped_objects = new_value
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
91
103
|
# Add the shortcut `nodes` field to this connection and its subclasses
|
92
104
|
def nodes_field(node_nullable: self.node_nullable, field_options: nil)
|
93
105
|
define_nodes_field(node_nullable, field_options: field_options)
|
@@ -170,6 +182,24 @@ module GraphQL
|
|
170
182
|
obj_type.field :page_info, GraphQL::Types::Relay::PageInfo, null: false, description: "Information to aid in pagination."
|
171
183
|
end
|
172
184
|
end
|
185
|
+
|
186
|
+
def edges
|
187
|
+
# Assume that whatever authorization needed to happen
|
188
|
+
# already happened at the connection level.
|
189
|
+
current_runtime_state = Thread.current[:__graphql_runtime_info]
|
190
|
+
query_runtime_state = current_runtime_state[context.query]
|
191
|
+
query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
|
192
|
+
@object.edges
|
193
|
+
end
|
194
|
+
|
195
|
+
def nodes
|
196
|
+
# Assume that whatever authorization needed to happen
|
197
|
+
# already happened at the connection level.
|
198
|
+
current_runtime_state = Thread.current[:__graphql_runtime_info]
|
199
|
+
query_runtime_state = current_runtime_state[context.query]
|
200
|
+
query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
|
201
|
+
@object.nodes
|
202
|
+
end
|
173
203
|
end
|
174
204
|
end
|
175
205
|
end
|
@@ -12,6 +12,13 @@ module GraphQL
|
|
12
12
|
child_class.node_nullable(true)
|
13
13
|
end
|
14
14
|
|
15
|
+
def node
|
16
|
+
current_runtime_state = Thread.current[:__graphql_runtime_info]
|
17
|
+
query_runtime_state = current_runtime_state[context.query]
|
18
|
+
query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
|
19
|
+
@object.node
|
20
|
+
end
|
21
|
+
|
15
22
|
module ClassMethods
|
16
23
|
def inherited(child_class)
|
17
24
|
super
|
data/lib/graphql/types.rb
CHANGED
@@ -6,6 +6,7 @@ require "graphql/types/id"
|
|
6
6
|
require "graphql/types/int"
|
7
7
|
require "graphql/types/iso_8601_date"
|
8
8
|
require "graphql/types/iso_8601_date_time"
|
9
|
+
require "graphql/types/iso_8601_duration"
|
9
10
|
require "graphql/types/json"
|
10
11
|
require "graphql/types/string"
|
11
12
|
require "graphql/types/relay"
|
data/lib/graphql/version.rb
CHANGED
data/lib/graphql.rb
CHANGED
@@ -88,6 +88,7 @@ require "graphql/integer_decoding_error"
|
|
88
88
|
require "graphql/integer_encoding_error"
|
89
89
|
require "graphql/string_encoding_error"
|
90
90
|
require "graphql/date_encoding_error"
|
91
|
+
require "graphql/duration_encoding_error"
|
91
92
|
require "graphql/type_kinds"
|
92
93
|
require "graphql/name_validator"
|
93
94
|
require "graphql/language"
|
@@ -101,9 +102,8 @@ require "graphql/execution"
|
|
101
102
|
require "graphql/pagination"
|
102
103
|
require "graphql/schema"
|
103
104
|
require "graphql/query"
|
104
|
-
require "graphql/types"
|
105
105
|
require "graphql/dataloader"
|
106
|
-
require "graphql/
|
106
|
+
require "graphql/types"
|
107
107
|
require "graphql/static_validation"
|
108
108
|
require "graphql/execution"
|
109
109
|
require "graphql/schema/built_in_types"
|
@@ -120,4 +120,4 @@ require "graphql/backtrace"
|
|
120
120
|
require "graphql/unauthorized_error"
|
121
121
|
require "graphql/unauthorized_field_error"
|
122
122
|
require "graphql/load_application_object_failed_error"
|
123
|
-
require "graphql/
|
123
|
+
require "graphql/testing"
|
data/readme.md
CHANGED
@@ -7,7 +7,7 @@ A Ruby implementation of [GraphQL](https://graphql.org/).
|
|
7
7
|
|
8
8
|
- [Website](https://graphql-ruby.org/)
|
9
9
|
- [API Documentation](https://www.rubydoc.info/github/rmosolgo/graphql-ruby)
|
10
|
-
- [Newsletter](https://
|
10
|
+
- [Newsletter](https://buttondown.email/graphql-ruby)
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -34,7 +34,17 @@ Or, see ["Getting Started"](https://graphql-ruby.org/getting_started.html).
|
|
34
34
|
|
35
35
|
## Upgrade
|
36
36
|
|
37
|
-
I also sell [GraphQL::Pro](https://graphql.pro) which provides several features on top of the GraphQL runtime, including
|
37
|
+
I also sell [GraphQL::Pro](https://graphql.pro) which provides several features on top of the GraphQL runtime, including:
|
38
|
+
|
39
|
+
- [Persisted queries](https://graphql-ruby.org/operation_store/overview)
|
40
|
+
- [API versioning](https://graphql-ruby.org/changesets/overview)
|
41
|
+
- [Streaming payloads](https://graphql-ruby.org/defer/overview)
|
42
|
+
- [Server-side caching](https://graphql-ruby.org/object_cache/overview)
|
43
|
+
- [Rate limiters](https://graphql-ruby.org/limiters/overview)
|
44
|
+
- Subscriptions backends for [Pusher](https://graphql-ruby.org/subscriptions/pusher_implementation) and [Ably](https://graphql-ruby.org/subscriptions/ably_implementation)
|
45
|
+
- Authorization plugins for [Pundit](https://graphql-ruby.org/authorization/pundit_integration) and [CanCan](https://graphql-ruby.org/authorization/can_can_integration)
|
46
|
+
|
47
|
+
Besides that, Pro customers get email support and an opportunity to support graphql-ruby's development!
|
38
48
|
|
39
49
|
## Goals
|
40
50
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: racc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: benchmark-ips
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +108,6 @@ dependencies:
|
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '1.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: racc
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.4'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.4'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -270,6 +270,7 @@ files:
|
|
270
270
|
- lib/generators/graphql/templates/base_input_object.erb
|
271
271
|
- lib/generators/graphql/templates/base_interface.erb
|
272
272
|
- lib/generators/graphql/templates/base_object.erb
|
273
|
+
- lib/generators/graphql/templates/base_resolver.erb
|
273
274
|
- lib/generators/graphql/templates/base_scalar.erb
|
274
275
|
- lib/generators/graphql/templates/base_union.erb
|
275
276
|
- lib/generators/graphql/templates/enum.erb
|
@@ -308,13 +309,14 @@ files:
|
|
308
309
|
- lib/graphql/backtrace/tracer.rb
|
309
310
|
- lib/graphql/coercion_error.rb
|
310
311
|
- lib/graphql/dataloader.rb
|
312
|
+
- lib/graphql/dataloader/async_dataloader.rb
|
311
313
|
- lib/graphql/dataloader/null_dataloader.rb
|
312
314
|
- lib/graphql/dataloader/request.rb
|
313
315
|
- lib/graphql/dataloader/request_all.rb
|
314
316
|
- lib/graphql/dataloader/source.rb
|
315
317
|
- lib/graphql/date_encoding_error.rb
|
316
|
-
- lib/graphql/deprecation.rb
|
317
318
|
- lib/graphql/dig.rb
|
319
|
+
- lib/graphql/duration_encoding_error.rb
|
318
320
|
- lib/graphql/execution.rb
|
319
321
|
- lib/graphql/execution/directive_checks.rb
|
320
322
|
- lib/graphql/execution/errors.rb
|
@@ -326,12 +328,12 @@ files:
|
|
326
328
|
- lib/graphql/execution/interpreter/handles_raw_value.rb
|
327
329
|
- lib/graphql/execution/interpreter/resolve.rb
|
328
330
|
- lib/graphql/execution/interpreter/runtime.rb
|
331
|
+
- lib/graphql/execution/interpreter/runtime/graphql_result.rb
|
329
332
|
- lib/graphql/execution/lazy.rb
|
330
333
|
- lib/graphql/execution/lazy/lazy_method_map.rb
|
331
334
|
- lib/graphql/execution/lookahead.rb
|
332
335
|
- lib/graphql/execution/multiplex.rb
|
333
336
|
- lib/graphql/execution_error.rb
|
334
|
-
- lib/graphql/filter.rb
|
335
337
|
- lib/graphql/integer_decoding_error.rb
|
336
338
|
- lib/graphql/integer_encoding_error.rb
|
337
339
|
- lib/graphql/introspection.rb
|
@@ -358,9 +360,9 @@ files:
|
|
358
360
|
- lib/graphql/language/lexer.rb
|
359
361
|
- lib/graphql/language/nodes.rb
|
360
362
|
- lib/graphql/language/parser.rb
|
361
|
-
- lib/graphql/language/parser.y
|
362
363
|
- lib/graphql/language/printer.rb
|
363
364
|
- lib/graphql/language/sanitized_printer.rb
|
365
|
+
- lib/graphql/language/static_visitor.rb
|
364
366
|
- lib/graphql/language/token.rb
|
365
367
|
- lib/graphql/language/visitor.rb
|
366
368
|
- lib/graphql/load_application_object_failed_error.rb
|
@@ -376,6 +378,7 @@ files:
|
|
376
378
|
- lib/graphql/parse_error.rb
|
377
379
|
- lib/graphql/query.rb
|
378
380
|
- lib/graphql/query/context.rb
|
381
|
+
- lib/graphql/query/context/scoped_context.rb
|
379
382
|
- lib/graphql/query/fingerprint.rb
|
380
383
|
- lib/graphql/query/input_validation_result.rb
|
381
384
|
- lib/graphql/query/null_context.rb
|
@@ -410,6 +413,7 @@ files:
|
|
410
413
|
- lib/graphql/schema/directive/include.rb
|
411
414
|
- lib/graphql/schema/directive/one_of.rb
|
412
415
|
- lib/graphql/schema/directive/skip.rb
|
416
|
+
- lib/graphql/schema/directive/specified_by.rb
|
413
417
|
- lib/graphql/schema/directive/transform.rb
|
414
418
|
- lib/graphql/schema/enum.rb
|
415
419
|
- lib/graphql/schema/enum_value.rb
|
@@ -419,6 +423,7 @@ files:
|
|
419
423
|
- lib/graphql/schema/field_extension.rb
|
420
424
|
- lib/graphql/schema/find_inherited_value.rb
|
421
425
|
- lib/graphql/schema/finder.rb
|
426
|
+
- lib/graphql/schema/has_single_input_argument.rb
|
422
427
|
- lib/graphql/schema/input_object.rb
|
423
428
|
- lib/graphql/schema/interface.rb
|
424
429
|
- lib/graphql/schema/introspection_system.rb
|
@@ -536,7 +541,6 @@ files:
|
|
536
541
|
- lib/graphql/static_validation/rules/variables_are_input_types_error.rb
|
537
542
|
- lib/graphql/static_validation/rules/variables_are_used_and_defined.rb
|
538
543
|
- lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb
|
539
|
-
- lib/graphql/static_validation/type_stack.rb
|
540
544
|
- lib/graphql/static_validation/validation_context.rb
|
541
545
|
- lib/graphql/static_validation/validation_timeout_error.rb
|
542
546
|
- lib/graphql/static_validation/validator.rb
|
@@ -546,8 +550,9 @@ files:
|
|
546
550
|
- lib/graphql/subscriptions/broadcast_analyzer.rb
|
547
551
|
- lib/graphql/subscriptions/default_subscription_resolve_extension.rb
|
548
552
|
- lib/graphql/subscriptions/event.rb
|
549
|
-
- lib/graphql/subscriptions/instrumentation.rb
|
550
553
|
- lib/graphql/subscriptions/serialize.rb
|
554
|
+
- lib/graphql/testing.rb
|
555
|
+
- lib/graphql/testing/helpers.rb
|
551
556
|
- lib/graphql/tracing.rb
|
552
557
|
- lib/graphql/tracing/active_support_notifications_trace.rb
|
553
558
|
- lib/graphql/tracing/active_support_notifications_tracing.rb
|
@@ -557,6 +562,7 @@ files:
|
|
557
562
|
- lib/graphql/tracing/appsignal_tracing.rb
|
558
563
|
- lib/graphql/tracing/data_dog_trace.rb
|
559
564
|
- lib/graphql/tracing/data_dog_tracing.rb
|
565
|
+
- lib/graphql/tracing/legacy_hooks_trace.rb
|
560
566
|
- lib/graphql/tracing/legacy_trace.rb
|
561
567
|
- lib/graphql/tracing/new_relic_trace.rb
|
562
568
|
- lib/graphql/tracing/new_relic_tracing.rb
|
@@ -565,10 +571,11 @@ files:
|
|
565
571
|
- lib/graphql/tracing/platform_trace.rb
|
566
572
|
- lib/graphql/tracing/platform_tracing.rb
|
567
573
|
- lib/graphql/tracing/prometheus_trace.rb
|
574
|
+
- lib/graphql/tracing/prometheus_trace/graphql_collector.rb
|
568
575
|
- lib/graphql/tracing/prometheus_tracing.rb
|
569
|
-
- lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
|
570
576
|
- lib/graphql/tracing/scout_trace.rb
|
571
577
|
- lib/graphql/tracing/scout_tracing.rb
|
578
|
+
- lib/graphql/tracing/sentry_trace.rb
|
572
579
|
- lib/graphql/tracing/statsd_trace.rb
|
573
580
|
- lib/graphql/tracing/statsd_tracing.rb
|
574
581
|
- lib/graphql/tracing/trace.rb
|
@@ -581,6 +588,7 @@ files:
|
|
581
588
|
- lib/graphql/types/int.rb
|
582
589
|
- lib/graphql/types/iso_8601_date.rb
|
583
590
|
- lib/graphql/types/iso_8601_date_time.rb
|
591
|
+
- lib/graphql/types/iso_8601_duration.rb
|
584
592
|
- lib/graphql/types/json.rb
|
585
593
|
- lib/graphql/types/relay.rb
|
586
594
|
- lib/graphql/types/relay/base_connection.rb
|
@@ -607,7 +615,7 @@ metadata:
|
|
607
615
|
changelog_uri: https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md
|
608
616
|
source_code_uri: https://github.com/rmosolgo/graphql-ruby
|
609
617
|
bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
|
610
|
-
mailing_list_uri: https://
|
618
|
+
mailing_list_uri: https://buttondown.email/graphql-ruby
|
611
619
|
post_install_message:
|
612
620
|
rdoc_options: []
|
613
621
|
require_paths:
|
@@ -616,14 +624,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
616
624
|
requirements:
|
617
625
|
- - ">="
|
618
626
|
- !ruby/object:Gem::Version
|
619
|
-
version: 2.
|
627
|
+
version: 2.7.0
|
620
628
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
621
629
|
requirements:
|
622
630
|
- - ">="
|
623
631
|
- !ruby/object:Gem::Version
|
624
632
|
version: '0'
|
625
633
|
requirements: []
|
626
|
-
rubygems_version: 3.
|
634
|
+
rubygems_version: 3.5.5
|
627
635
|
signing_key:
|
628
636
|
specification_version: 4
|
629
637
|
summary: A GraphQL language and runtime for Ruby
|
data/lib/graphql/deprecation.rb
DELETED
data/lib/graphql/filter.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require "graphql/deprecation"
|
3
|
-
|
4
|
-
module GraphQL
|
5
|
-
# @api private
|
6
|
-
class Filter
|
7
|
-
def initialize(only: nil, except: nil, silence_deprecation_warning: false)
|
8
|
-
if !silence_deprecation_warning
|
9
|
-
line = caller(2, 10).find { |l| !l.include?("lib/graphql") }
|
10
|
-
GraphQL::Deprecation.warn("GraphQL::Filter, `only:`, `except:`, and `.merge_filters` are deprecated and will be removed in v2.1.0. Implement `visible?` on your schema members instead (https://graphql-ruby.org/authorization/visibility.html).\n #{line}")
|
11
|
-
end
|
12
|
-
@only = only
|
13
|
-
@except = except
|
14
|
-
end
|
15
|
-
|
16
|
-
# Returns true if `member, ctx` passes this filter
|
17
|
-
def call(member, ctx)
|
18
|
-
(@only ? @only.call(member, ctx) : true) &&
|
19
|
-
(@except ? !@except.call(member, ctx) : true)
|
20
|
-
end
|
21
|
-
|
22
|
-
def merge(only: nil, except: nil)
|
23
|
-
onlies = [self].concat(Array(only))
|
24
|
-
merged_only = MergedOnly.build(onlies)
|
25
|
-
merged_except = MergedExcept.build(Array(except))
|
26
|
-
self.class.new(only: merged_only, except: merged_except, silence_deprecation_warning: true)
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
class MergedOnly
|
32
|
-
def initialize(first, second)
|
33
|
-
@first = first
|
34
|
-
@second = second
|
35
|
-
end
|
36
|
-
|
37
|
-
def call(member, ctx)
|
38
|
-
@first.call(member, ctx) && @second.call(member, ctx)
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.build(onlies)
|
42
|
-
case onlies.size
|
43
|
-
when 0
|
44
|
-
nil
|
45
|
-
when 1
|
46
|
-
onlies[0]
|
47
|
-
else
|
48
|
-
onlies.reduce { |memo, only| self.new(memo, only) }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
class MergedExcept < MergedOnly
|
54
|
-
def call(member, ctx)
|
55
|
-
@first.call(member, ctx) || @second.call(member, ctx)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|