Skip to content

Conversation

@schpet
Copy link
Contributor

@schpet schpet commented Oct 22, 2025

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'

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'
@rmosolgo
Copy link
Owner

Hey, thanks for sharing this fix! Does graphql-ruby provide any more of the backtrace than that? Out of curiousity, I'm wondering where/why it's initializing a Warden instance when Visibility has been added to the schema.

@schpet
Copy link
Contributor Author

schpet commented Oct 24, 2025

@rmosolgo thanks for checking this out! here's a more full dump below. happy to provide a full repro if that's helpful, but might take me a couple days to get to it.

un bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"

Randomized with seed 38324
DEPRECATION:  "Mutation.internalAdminUserUpdate" field returned `false` for `.visible?` but `GraphQL::Schema::Visibility` isn't configured yet.

.......................................    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:207:in 'block in GraphQL::Schema::Warden#initialize'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:500:in 'block in GraphQL::Schema::Warden#read_through'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:496:in 'GraphQL::Schema::Warden#visible?'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:377:in 'GraphQL::Schema::Warden#visible_field?'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:54:in 'Kernel#public_send'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:54:in 'GraphQL::Schema::Warden.visible_entry?'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_fields.rb:177:in 'block (2 levels) in GraphQL::Schema::Member::HasFields::ObjectMethods#fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_fields.rb:173:in 'Hash#each'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_fields.rb:173:in 'block in GraphQL::Schema::Member::HasFields::ObjectMethods#fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_fields.rb:171:in 'Array#each'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_fields.rb:171:in 'GraphQL::Schema::Member::HasFields::ObjectMethods#fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema.rb:742:in 'GraphQL::Schema.get_fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:312:in 'block in GraphQL::Schema::Warden#fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:500:in 'block in GraphQL::Schema::Warden#read_through'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:313:in 'GraphQL::Schema::Warden#fields'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:627:in 'GraphQL::Schema::Warden#visit_type'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:587:in 'GraphQL::Schema::Warden#reachable_type_set'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:275:in 'GraphQL::Schema::Warden#reachable_type?'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/warden.rb:190:in 'GraphQL::Schema::Warden::VisibilityProfile#reachable_type?'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/introspection/entry_points.rb:18:in 'GraphQL::Introspection::EntryPoints#__type'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/field.rb:758:in 'Kernel#public_send'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/field.rb:758:in 'block (2 levels) in GraphQL::Schema::Field#resolve'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/field.rb:892:in 'GraphQL::Schema::Field#with_extensions'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/field.rb:729:in 'block in GraphQL::Schema::Field#resolve'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:882:in 'GraphQL::Execution::Interpreter::Runtime#minimal_after_lazy'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/query.rb:28:in 'GraphQL::Query::Runnable#after_lazy'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/field.rb:727:in 'GraphQL::Schema::Field#resolve'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:467:in 'block (2 levels) in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/tracing/trace.rb:90:in 'GraphQL::Tracing::Trace#execute_field'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:466:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:820:in 'GraphQL::Execution::Interpreter::Runtime#call_method_on_directives'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:454:in 'GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:432:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_args'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:941:in 'GraphQL::Execution::Interpreter::Runtime#after_lazy'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:377:in 'GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_args'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/runtime.rb:371:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/arguments_cache.rb:46:in 'block in GraphQL::Execution::Interpreter::ArgumentsCache#dataload_for'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_arguments.rb:272:in 'block (3 levels) in GraphQL::Schema::Member::HasArguments#coerce_arguments'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'BasicObject#instance_exec'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'block in RSpec::Core::Example#run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:511:in 'block in RSpec::Core::Example#with_around_and_singleton_context_hooks'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:468:in 'block in RSpec::Core::Example#with_around_example_hooks'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:486:in 'block in RSpec::Core::Hooks::HookCollections#run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:626:in 'block in RSpec::Core::Hooks::HookCollections#run_around_example_hooks_for'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:352:in 'RSpec::Core::Example::Procsy#call'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-rails-8.0.2/lib/rspec/rails/adapters.rb:75:in 'block (2 levels) in <module:MinitestLifecycleAdapter>'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:457:in 'BasicObject#instance_exec'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:457:in 'RSpec::Core::Example#instance_exec'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:390:in 'RSpec::Core::Hooks::AroundHook#execute_with'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:628:in 'block (2 levels) in RSpec::Core::Hooks::HookCollections#run_around_example_hooks_for'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:352:in 'RSpec::Core::Example::Procsy#call'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:629:in 'RSpec::Core::Hooks::HookCollections#run_around_example_hooks_for'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:486:in 'RSpec::Core::Hooks::HookCollections#run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:468:in 'RSpec::Core::Example#with_around_example_hooks'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:511:in 'RSpec::Core::Example#with_around_and_singleton_context_hooks'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:259:in 'RSpec::Core::Example#run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:653:in 'block in RSpec::Core::ExampleGroup.run_examples'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:649:in 'Array#map'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:649:in 'RSpec::Core::ExampleGroup.run_examples'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:614:in 'RSpec::Core::ExampleGroup.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'block in RSpec::Core::ExampleGroup.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'Array#map'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'RSpec::Core::ExampleGroup.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'block in RSpec::Core::ExampleGroup.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'Array#map'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'RSpec::Core::ExampleGroup.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'block (3 levels) in RSpec::Core::Runner#run_specs'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'Array#map'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'block (2 levels) in RSpec::Core::Runner#run_specs'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/configuration.rb:2097:in 'RSpec::Core::Configuration#with_suite_hooks'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:116:in 'block in RSpec::Core::Runner#run_specs'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/reporter.rb:74:in 'RSpec::Core::Reporter#report'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:115:in 'RSpec::Core::Runner#run_specs'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:89:in 'RSpec::Core::Runner#run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:71:in 'RSpec::Core::Runner.run'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:45:in 'RSpec::Core::Runner.invoke'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/exe/rspec:4:in '<top (required)>'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/bin/rspec:25:in 'Kernel#load'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/bin/rspec:25:in '<top (required)>'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:58:in 'Kernel.load'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:58:in 'Bundler::CLI::Exec#kernel_load'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli.rb:455:in 'Bundler::CLI#exec'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor.rb:527:in 'Bundler::Thor.dispatch'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/cli.rb:29:in 'Bundler::CLI.start'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/exe/bundle:28:in 'block in <top (required)>'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/gems/3.4.0/gems/bundler-2.5.17/exe/bundle:20:in '<top (required)>'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/bin/bundle:25:in 'Kernel#load'
    /opt/hostedtoolcache/Ruby/3.4.6/x64/bin/bundle:25:in '<main>'

@rmosolgo
Copy link
Owner

rmosolgo commented Dec 9, 2025

👋 Sorry I haven't followed up on this in a while.

I don't think hiding this warning is the right thing because it is using Warden in this case, not the new Visibility module. (I see all those Warden#... methods at the top of the backtrace.)

I'd like to figure out why it's using the legacy module here when it shouldn't. Here's what stands out to me:

    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/execution/interpreter/arguments_cache.rb:46:in 'block in GraphQL::Execution::Interpreter::ArgumentsCache#dataload_for'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/graphql-2.5.14/lib/graphql/schema/member/has_arguments.rb:272:in 'block (3 levels) in GraphQL::Schema::Member::HasArguments#coerce_arguments'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'BasicObject#instance_exec'
    /home/runner/work/tanooki-prefab/tanooki-prefab/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'block in RSpec::Core::Example#run'

The code jumps right from Rspec to GraphQL-Ruby's coerce_arguments method. This surprises me because that method is usually called inside query execution, but not directly. Maybe this test is calling GraphQL-Ruby in an unusual or unexpected way.

Do you mind sharing the source for the test that emits this warning?

My guess is that the code being called doesn't produce the right default when called in this way. Once we track it down, I can update it to use the right thing.

@schpet
Copy link
Contributor Author

schpet commented Dec 9, 2025

@rmosolgo thanks for checking this out again :-)

Do you mind sharing the source for the test that emits this warning?

i've pushed up a repo here that reproduces it:
https://github.com/schpet/graphql-ruby-warning-repro

❯ bundle exec rspec spec/graphql/schema_spec.rb

GraphqlRubyWarningReproSchema
DEPRECATION: GraphqlRubyWarningReproSchema's "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 GraphqlRubyWarningReproSchema. (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
  triggers deprecation warning when querying hidden field

Finished in 0.04937 seconds (files took 0.5929 seconds to load)
1 example, 0 failures

i'll read through your comment again later and try to narrow it down (maybe the spec/support/graphql_helpers.rb is an issue?) – but thought i'd provide this right away in case it's helpful to you.

@rmosolgo
Copy link
Owner

rmosolgo commented Dec 9, 2025

Hey, thanks for sharing that repro. I pulled it, bundled it, ran the tests, and saw the warning. In this case, the warning applies: the schema doesn't include use GraphQL::Schema::Visibility or use GraphQL::Schema::Warden.

When I add either one of those use ... configurations and run the tests again, there's no warning. Do those fixes work for you on the reproduction app?

Does your real app schema have one of those use ... configurations?

@schpet schpet closed this Dec 9, 2025
@schpet schpet reopened this Dec 9, 2025
@schpet
Copy link
Contributor Author

schpet commented Dec 9, 2025

@rmosolgo ah of course 🤦🏻‍♂️.

i've looked at the reproduction, and the tests triggering this, and then realized my schema did have the use calls but the tests in questions made new schemas that were missing them. so operator error here, working as intended. apologies for the bad report, and appreciate you helping me identify the error 🙏🏻.

@schpet schpet closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants