The field exists. The method doesn’t.
Find missing resolver methods and visibility problems. Explicitly allow fields resolved by their underlying objects.
A contract checker for GraphQL-Ruby
Your schema makes a promise. Your Ruby needs to keep it. Find resolver contract errors before a query reaches production.
Open source, MIT licensed. Built for your Ruby workflow.
class Search < GraphQL::Schema::Resolver type [String], null: false argument :title, String, required: false def resolve(title:) [title].compact endend
GraphQL can omit title:.
Your Ruby method requires it.
Fix: use title: nil or add a GraphQL default.
graphql-doctor connects your runtime schema with Prism-parsed Ruby source. It checks where the two meet, and points you to the code that needs attention.
Find missing resolver methods and visibility problems. Explicitly allow fields resolved by their underlying objects.
Check Ruby keywords against GraphQL arguments, including loads:, as:, extras:, defaults, and nullability.
Catch incompatible ready? and authorized? signatures before they interrupt resolution.
Find unregistered resolver and mutation classes. Declare your abstract bases to keep the results relevant.
Add the gem, point it at your schema, and run your first check.
Run it in the application that owns your schema. By default, it indexes Ruby files in app/graphql/**/*.rb.
group :development, :test do
gem "graphql-doctor"
end
Then run bundle install.
schema: MyAppSchema
require: ./config/environment
Replace MyAppSchema with your schema class.
bundle exec graphql-doctor check
Get source locations, diagnostic codes, and suggested fixes.
Run the same check in CI. Surface findings as GitHub Actions annotations, or use JSON and SARIF in your existing tools.
Set up CIbundle exec graphql-doctor check \
--format github
Can’t boot the app in the checking job? Export a schema dump and pass it with --schema-dump and --no-boot.