DmitryTsepelev/rubocop-graphql

Rubocop extension for enforcing graphql-ruby best practices

245

stars

233

commits

Ruby

primary language

Aug 30, 2026

updated

best-practices
graphql
linter
rubocop
rubocop-graphql
ruby
static-code-analysis

README

RuboCop::GraphQL

Rubocop extension for enforcing graphql-ruby best practices.

Professional Support

Need help with your GraphQL API architecture, schema design, or performance? I'm available for consulting — get in touch.

Installation

Install the gem:

gem install rubocop-graphql

If you use bundler put this in your Gemfile:

gem 'rubocop-graphql', require: false

Usage

You need to tell RuboCop to load the GraphQL extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

plugins: rubocop-graphql

Alternatively, use the following array notation when specifying multiple extensions.

plugins:
  - rubocop-other-extension
  - rubocop-graphql

Now you can run rubocop and it will automatically load the RuboCop GraphQL cops together with the standard cops.

[!NOTE] The plugin system is supported in RuboCop 1.72+. In earlier versions, use require instead of plugins.

Command line

rubocop --plugins rubocop-graphql

Rake task

RuboCop::RakeTask.new do |task|
  task.plugins << 'rubocop-graphql'
end

The Cops

All cops are located under lib/rubocop/cop/graphql, and contain examples and documentation.

In your .rubocop.yml, you may treat the GraphQL cops just like any other cop. For example:

GraphQL/ResolverMethodLength:
  Max: 3

Credits

Initially sponsored by Evil Martians.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DmitryTsepelev/rubocop-graphql.

License

The gem is available as open source under the terms of the MIT License.

Contributors

(top 30 of 48)

DmitryTsepelev

141 commits

nvasilevski

9 commits

danielvdao

6 commits

corsonknowles

6 commits

DmitryTsepelev/rubocop-graphql

Rubocop extension for enforcing graphql-ruby best practices

245

stars

233

commits

Ruby

primary language

Aug 30, 2026

updated

best-practices
graphql
linter
rubocop
rubocop-graphql
ruby
static-code-analysis

README

RuboCop::GraphQL

Rubocop extension for enforcing graphql-ruby best practices.

Professional Support

Need help with your GraphQL API architecture, schema design, or performance? I'm available for consulting — get in touch.

Installation

Install the gem:

gem install rubocop-graphql

If you use bundler put this in your Gemfile:

gem 'rubocop-graphql', require: false

Usage

You need to tell RuboCop to load the GraphQL extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

plugins: rubocop-graphql

Alternatively, use the following array notation when specifying multiple extensions.

plugins:
  - rubocop-other-extension
  - rubocop-graphql

Now you can run rubocop and it will automatically load the RuboCop GraphQL cops together with the standard cops.

[!NOTE] The plugin system is supported in RuboCop 1.72+. In earlier versions, use require instead of plugins.

Command line

rubocop --plugins rubocop-graphql

Rake task

RuboCop::RakeTask.new do |task|
  task.plugins << 'rubocop-graphql'
end

The Cops

All cops are located under lib/rubocop/cop/graphql, and contain examples and documentation.

In your .rubocop.yml, you may treat the GraphQL cops just like any other cop. For example:

GraphQL/ResolverMethodLength:
  Max: 3

Credits

Initially sponsored by Evil Martians.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DmitryTsepelev/rubocop-graphql.

License

The gem is available as open source under the terms of the MIT License.

Contributors

(top 30 of 48)

DmitryTsepelev

141 commits

nvasilevski

9 commits

danielvdao

6 commits

corsonknowles

6 commits

Languages

Ruby

100.0%