Skip to content

Commit b52c317

Browse files
committed
Remove unused vis code, don't freeze types
1 parent beff0d0 commit b52c317

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

lib/graphql/schema/ractor_shareable.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def freeze_schema
3838
@frozen_directives = Ractor.make_shareable(directives)
3939

4040
Ractor.make_shareable(visibility)
41-
visibility.types.each do |_name, type_defn|
42-
type_defn.freeze
43-
end
4441
Ractor.make_shareable(introspection_system)
4542
extend(FrozenMethods)
4643

lib/graphql/schema/visibility.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def initialize(schema, dynamic:, preload:, profiles:, migration_errors:)
3232
Visibility::Profile
3333
end
3434
@preload = preload
35-
@preloaded = false
3635
@profiles = profiles
3736
@cached_profiles = {}
3837
@dynamic = dynamic
@@ -81,10 +80,6 @@ def preload?
8180
end
8281

8382
def preload
84-
if @preloaded
85-
raise "Invariant: can't preload twice"
86-
end
87-
@preloaded = true
8883
# Traverse the schema now (and in the *_configured hooks below)
8984
# To make sure things are loaded during boot
9085
@preloaded_types = Set.new
@@ -215,7 +210,6 @@ def ensure_all_loaded(types_to_visit)
215210
end
216211

217212
def load_all(types: nil)
218-
return if frozen?
219213
if @visit.nil?
220214
# Set up the visit system
221215
@interface_type_memberships = Hash.new { |h, interface_type| h[interface_type] = [] }.compare_by_identity

spec/graphql/schema/ractor_shareable_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Query < GraphQL::Schema::Object
6969
query(q)
7070
end
7171

72-
assert_equal "Query", new_schema.execute("{ __typename }")["data"]["__typename"]
72+
assert_equal "Query", new_schema.execute("{ __typename @include(if: true) }")["data"]["__typename"]
7373
end
7474
end
7575
end

0 commit comments

Comments
 (0)