From 70d78c8721ffaabc93de7a82fc5ab30bd15bd987 Mon Sep 17 00:00:00 2001 From: Peter Schilling Date: Wed, 22 Oct 2025 14:25:04 -0700 Subject: [PATCH] Hide deprecation warning when GraphQL::Schema::Visibility is included right now i get this deprecation, even when i have Schema::Visibility included in my schema > DEPRECATION: "Query.internalAdminUsers" field returned `false` for `.visible?` but `GraphQL::Schema::Visibility` isn't configured yet. > > Address this warning by adding: > > use GraphQL::Schema::Visibility > > to the definition for your schema. (Future GraphQL-Ruby versions won't check `.visible?` methods by default.) > > Alternatively, for legacy behavior, add: > > use GraphQL::Schema::Warden # legacy visibility behavior > > For more information see: https://graphql-ruby.org/authorization/visibility.html > /Users/schpet/.rbenv/versions/3.4.6/lib/ruby/gems/3.4.0/gems/graphql-2.5.13/lib/graphql/schema/warden.rb:207:in 'block in GraphQL::Schema::Warden#initialize' --- lib/graphql/schema/warden.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graphql/schema/warden.rb b/lib/graphql/schema/warden.rb index d74956738f..e912584ed2 100644 --- a/lib/graphql/schema/warden.rb +++ b/lib/graphql/schema/warden.rb @@ -212,7 +212,7 @@ def initialize(context:, schema:) @visible_and_reachable_type = @unions = @unfiltered_interfaces = @reachable_type_set = @visibility_profile = @loadable_possible_types = nil - @skip_warning = schema.plugins.any? { |(plugin, _opts)| plugin == GraphQL::Schema::Warden } + @skip_warning = schema.plugins.any? { |(plugin, _opts)| plugin == GraphQL::Schema::Warden || plugin == GraphQL::Schema::Visibility } end attr_writer :skip_warning