graphql 2.4.3 → 2.4.5
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/analysis/visitor.rb +1 -1
- data/lib/graphql/analysis.rb +3 -3
- data/lib/graphql/autoload.rb +37 -0
- data/lib/graphql/current.rb +1 -1
- data/lib/graphql/dataloader/async_dataloader.rb +4 -4
- data/lib/graphql/dataloader/source.rb +1 -1
- data/lib/graphql/dataloader.rb +6 -9
- data/lib/graphql/execution/interpreter/resolve.rb +3 -3
- data/lib/graphql/execution/interpreter/runtime.rb +7 -7
- data/lib/graphql/execution/interpreter.rb +4 -4
- data/lib/graphql/language/cache.rb +13 -0
- data/lib/graphql/language/document_from_schema_definition.rb +8 -7
- data/lib/graphql/language/lexer.rb +4 -1
- data/lib/graphql/language/printer.rb +8 -8
- data/lib/graphql/pagination/connection.rb +1 -1
- data/lib/graphql/query/context/scoped_context.rb +1 -1
- data/lib/graphql/query/context.rb +6 -5
- data/lib/graphql/query/variable_validation_error.rb +1 -1
- data/lib/graphql/query.rb +12 -10
- data/lib/graphql/railtie.rb +7 -0
- data/lib/graphql/schema/addition.rb +1 -1
- data/lib/graphql/schema/directive/flagged.rb +1 -1
- data/lib/graphql/schema/directive.rb +1 -1
- data/lib/graphql/schema/field/scope_extension.rb +1 -1
- data/lib/graphql/schema/field.rb +10 -10
- data/lib/graphql/schema/field_extension.rb +1 -1
- data/lib/graphql/schema/has_single_input_argument.rb +3 -1
- data/lib/graphql/schema/input_object.rb +64 -27
- data/lib/graphql/schema/interface.rb +1 -1
- data/lib/graphql/schema/loader.rb +1 -1
- data/lib/graphql/schema/member/has_arguments.rb +12 -12
- data/lib/graphql/schema/member/has_directives.rb +3 -3
- data/lib/graphql/schema/member/has_fields.rb +18 -0
- data/lib/graphql/schema/member/has_interfaces.rb +4 -4
- data/lib/graphql/schema/member/has_validators.rb +1 -1
- data/lib/graphql/schema/object.rb +8 -0
- data/lib/graphql/schema/relay_classic_mutation.rb +0 -1
- data/lib/graphql/schema/resolver.rb +5 -5
- data/lib/graphql/schema/subscription.rb +2 -2
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/validator.rb +1 -1
- data/lib/graphql/schema/visibility/profile.rb +61 -235
- data/lib/graphql/schema/visibility/visit.rb +190 -0
- data/lib/graphql/schema/visibility.rb +162 -26
- data/lib/graphql/schema/warden.rb +4 -4
- data/lib/graphql/schema.rb +33 -12
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +1 -1
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
- data/lib/graphql/static_validation/validation_context.rb +1 -0
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -1
- data/lib/graphql/subscriptions.rb +1 -1
- data/lib/graphql/testing/helpers.rb +2 -2
- data/lib/graphql/types/relay/connection_behaviors.rb +2 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +1 -1
- data/lib/graphql/types.rb +18 -11
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +80 -47
- metadata +4 -2
data/lib/graphql.rb
CHANGED
@@ -5,8 +5,18 @@ require "set"
|
|
5
5
|
require "singleton"
|
6
6
|
require "forwardable"
|
7
7
|
require "fiber/storage"
|
8
|
+
require "graphql/autoload"
|
8
9
|
|
9
10
|
module GraphQL
|
11
|
+
extend Autoload
|
12
|
+
|
13
|
+
# Load all `autoload`-configured classes, and also eager-load dependents who have autoloads of their own.
|
14
|
+
def self.eager_load!
|
15
|
+
super
|
16
|
+
Query.eager_load!
|
17
|
+
Types.eager_load!
|
18
|
+
end
|
19
|
+
|
10
20
|
class Error < StandardError
|
11
21
|
end
|
12
22
|
|
@@ -71,56 +81,79 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
|
|
71
81
|
class << self
|
72
82
|
# If true, the parser should raise when an integer or float is followed immediately by an identifier (instead of a space or punctuation)
|
73
83
|
attr_accessor :reject_numbers_followed_by_names
|
84
|
+
|
85
|
+
# If `production?` is detected but `eager_load!` wasn't called, emit a warning.
|
86
|
+
# @return [void]
|
87
|
+
def ensure_eager_load!
|
88
|
+
if production? && !eager_loading?
|
89
|
+
warn <<~WARNING
|
90
|
+
GraphQL-Ruby thinks this is a production deployment but didn't eager-load its constants. Address this by:
|
91
|
+
|
92
|
+
- Calling `GraphQL.eager_load!` in a production-only initializer or setup hook
|
93
|
+
- Assign `GraphQL.env = "..."` to something _other_ than `"production"` (for example, `GraphQL.env = "development"`)
|
94
|
+
|
95
|
+
More details: https://graphql-ruby.org/schema/definition#production-considerations
|
96
|
+
WARNING
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
attr_accessor :env
|
101
|
+
|
102
|
+
private
|
103
|
+
|
104
|
+
# Detect whether this is a production deployment or not
|
105
|
+
def production?
|
106
|
+
if env
|
107
|
+
# Manually assigned to production?
|
108
|
+
env == "production"
|
109
|
+
else
|
110
|
+
(detected_env = ENV["RACK_ENV"] || ENV["RAILS_ENV"] || ENV["HANAMI_ENV"] || ENV["APP_ENV"]) && detected_env.to_s.downcase == "production"
|
111
|
+
end
|
112
|
+
end
|
74
113
|
end
|
75
114
|
|
76
115
|
self.reject_numbers_followed_by_names = false
|
77
|
-
end
|
78
116
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
117
|
+
autoload :ExecutionError, "graphql/execution_error"
|
118
|
+
autoload :RuntimeTypeError, "graphql/runtime_type_error"
|
119
|
+
autoload :UnresolvedTypeError, "graphql/unresolved_type_error"
|
120
|
+
autoload :InvalidNullError, "graphql/invalid_null_error"
|
121
|
+
autoload :AnalysisError, "graphql/analysis_error"
|
122
|
+
autoload :CoercionError, "graphql/coercion_error"
|
123
|
+
autoload :InvalidNameError, "graphql/invalid_name_error"
|
124
|
+
autoload :IntegerDecodingError, "graphql/integer_decoding_error"
|
125
|
+
autoload :IntegerEncodingError, "graphql/integer_encoding_error"
|
126
|
+
autoload :StringEncodingError, "graphql/string_encoding_error"
|
127
|
+
autoload :DateEncodingError, "graphql/date_encoding_error"
|
128
|
+
autoload :DurationEncodingError, "graphql/duration_encoding_error"
|
129
|
+
autoload :TypeKinds, "graphql/type_kinds"
|
130
|
+
autoload :NameValidator, "graphql/name_validator"
|
131
|
+
autoload :Language, "graphql/language"
|
132
|
+
|
133
|
+
autoload :Analysis, "graphql/analysis"
|
134
|
+
autoload :Tracing, "graphql/tracing"
|
135
|
+
autoload :Dig, "graphql/dig"
|
136
|
+
autoload :Execution, "graphql/execution"
|
137
|
+
autoload :Pagination, "graphql/pagination"
|
138
|
+
autoload :Schema, "graphql/schema"
|
139
|
+
autoload :Query, "graphql/query"
|
140
|
+
autoload :Dataloader, "graphql/dataloader"
|
141
|
+
autoload :Types, "graphql/types"
|
142
|
+
autoload :StaticValidation, "graphql/static_validation"
|
143
|
+
autoload :Execution, "graphql/execution"
|
144
|
+
autoload :Introspection, "graphql/introspection"
|
145
|
+
autoload :Relay, "graphql/relay"
|
146
|
+
autoload :Subscriptions, "graphql/subscriptions"
|
147
|
+
autoload :ParseError, "graphql/parse_error"
|
148
|
+
autoload :Backtrace, "graphql/backtrace"
|
149
|
+
|
150
|
+
autoload :UnauthorizedError, "graphql/unauthorized_error"
|
151
|
+
autoload :UnauthorizedEnumValueError, "graphql/unauthorized_enum_value_error"
|
152
|
+
autoload :UnauthorizedFieldError, "graphql/unauthorized_field_error"
|
153
|
+
autoload :LoadApplicationObjectFailedError, "graphql/load_application_object_failed_error"
|
154
|
+
autoload :Testing, "graphql/testing"
|
155
|
+
autoload :Current, "graphql/current"
|
156
|
+
end
|
115
157
|
|
116
158
|
require "graphql/version"
|
117
|
-
require "graphql/
|
118
|
-
require "graphql/parse_error"
|
119
|
-
require "graphql/backtrace"
|
120
|
-
|
121
|
-
require "graphql/unauthorized_error"
|
122
|
-
require "graphql/unauthorized_enum_value_error"
|
123
|
-
require "graphql/unauthorized_field_error"
|
124
|
-
require "graphql/load_application_object_failed_error"
|
125
|
-
require "graphql/testing"
|
126
|
-
require "graphql/current"
|
159
|
+
require "graphql/railtie" if defined? Rails::Railtie
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -328,6 +328,7 @@ files:
|
|
328
328
|
- lib/graphql/analysis/query_depth.rb
|
329
329
|
- lib/graphql/analysis/visitor.rb
|
330
330
|
- lib/graphql/analysis_error.rb
|
331
|
+
- lib/graphql/autoload.rb
|
331
332
|
- lib/graphql/backtrace.rb
|
332
333
|
- lib/graphql/backtrace/inspect_result.rb
|
333
334
|
- lib/graphql/backtrace/table.rb
|
@@ -504,6 +505,7 @@ files:
|
|
504
505
|
- lib/graphql/schema/visibility.rb
|
505
506
|
- lib/graphql/schema/visibility/migration.rb
|
506
507
|
- lib/graphql/schema/visibility/profile.rb
|
508
|
+
- lib/graphql/schema/visibility/visit.rb
|
507
509
|
- lib/graphql/schema/warden.rb
|
508
510
|
- lib/graphql/schema/wrapper.rb
|
509
511
|
- lib/graphql/static_validation.rb
|