class GraphQL::Rubocop::GraphQL::FieldTypeInBlock

Identify (and auto-correct) any field whose type configuration isn’t given in the configuration block.

Examples

Example: # bad, immediately causes Rails to load app/graphql/types/thing.rb

field :thing, Types::Thing

# good, defers loading until the file is needed
field :thing do
  type(Types::Thing)
end