graphql 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbf9779d0fbc1da481a481d987489b980818c5ea6afb352f4e65f0654ea14163
4
- data.tar.gz: 91528aabb657b8602c7f3143b6a9dc3a770a336f6a31af0f89fce1c27e5e00a0
3
+ metadata.gz: 0dcc846071132cf2d084ff65347dab7c97d0b25b60c1cdb6dfcbe37c55f278e9
4
+ data.tar.gz: afc95cb5ba89e33974b8b38616bc36c14dcbfd3c9f121b8e65437e7cfc390770
5
5
  SHA512:
6
- metadata.gz: c73cedf9cd1fc6ab4d91f026dfe627cb1490d5888d1252f591b944359e1f537a479c5d7f7ceed691ddd79883ae1ba027dfb952e969d14617e6a19becee792aa6
7
- data.tar.gz: 4d429bb74350c9fbbaa0e33498ccb193acfa6691f62342b38923965e69bc23bb377e6ade8a56b8f5d5c785ea24a2f6e04a47a8384000a45140d320e7461c6832
6
+ metadata.gz: d1b6ad8fba792ca671246b2d6531f981a2c184adde3e4efc7522a7f38ea659c563dadd50ee208ab406f0ce4c37fc6625c2d59e020b0334cdefd8ea7f5d5eed8a
7
+ data.tar.gz: 74c1156b7b407b2d687cc74886198d9f2705d7d82e3672e5d5b9b61f2811fa53dfe7b2bdb61ac0dae8e5e83242415ff7d7d1f6e2721f77b90dcda61dff88c815
@@ -56,7 +56,14 @@ module GraphQL
56
56
  else
57
57
  @arguments = if @field
58
58
  @query.after_lazy(@query.arguments_for(@ast_nodes.first, @field)) do |args|
59
- args.is_a?(Execution::Interpreter::Arguments) ? args.keyword_arguments : args
59
+ case args
60
+ when Execution::Interpreter::Arguments
61
+ args.keyword_arguments
62
+ when GraphQL::ExecutionError
63
+ EmptyObjects::EMPTY_HASH
64
+ else
65
+ args
66
+ end
60
67
  end
61
68
  else
62
69
  nil
@@ -112,7 +112,11 @@ module GraphQL
112
112
  if @profiles.any?
113
113
  if visibility_profile.nil?
114
114
  if @dynamic
115
- @schema.visibility_profile_class.new(context: context, schema: @schema)
115
+ if context.is_a?(Query::NullContext)
116
+ top_level_profile
117
+ else
118
+ @schema.visibility_profile_class.new(context: context, schema: @schema)
119
+ end
116
120
  elsif @profiles.any?
117
121
  raise ArgumentError, "#{@schema} expects a visibility profile, but `visibility_profile:` wasn't passed. Provide a `visibility_profile:` value or add `dynamic: true` to your visibility configuration."
118
122
  end
@@ -121,6 +125,8 @@ module GraphQL
121
125
  else
122
126
  @cached_profiles[visibility_profile] ||= @schema.visibility_profile_class.new(name: visibility_profile, context: context, schema: @schema)
123
127
  end
128
+ elsif context.is_a?(Query::NullContext)
129
+ top_level_profile
124
130
  else
125
131
  @schema.visibility_profile_class.new(context: context, schema: @schema)
126
132
  end
@@ -128,6 +134,13 @@ module GraphQL
128
134
 
129
135
  private
130
136
 
137
+ def top_level_profile(refresh: false)
138
+ if refresh
139
+ @top_level_profile = nil
140
+ end
141
+ @top_level_profile ||= @schema.visibility_profile_class.new(context: Query::NullContext.instance, schema: @schema)
142
+ end
143
+
131
144
  def ensure_all_loaded(types_to_visit)
132
145
  while (type = types_to_visit.shift)
133
146
  if type.kind.fields? && @preloaded_types.add?(type)
@@ -137,6 +150,8 @@ module GraphQL
137
150
  end
138
151
  end
139
152
  end
153
+ top_level_profile(refresh: true)
154
+ nil
140
155
  end
141
156
  end
142
157
  end
@@ -492,7 +492,7 @@ module GraphQL
492
492
  nil
493
493
  elsif @mutation_object.is_a?(Proc)
494
494
  @mutation_object = @mutation_object.call
495
- self.visibility&.mutation_configured(@query_object)
495
+ self.visibility&.mutation_configured(@mutation_object)
496
496
  @mutation_object
497
497
  else
498
498
  @mutation_object || find_inherited_value(:mutation)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.4.2"
3
+ VERSION = "2.4.3"
4
4
  end
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.2
4
+ version: 2.4.3
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-07 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64