class GraphQL::Rubocop::GraphQL::DefaultNullTrue
field :name, String
# good
field :name, String, null: true
# bad
# Both of these define ‘name: String` in GraphQL:
@example
to `null: true`, change.)
to non-null fields (`null: false`) without a breaking change. (The opposite change, from `null: false`
`null: true` is default because nullable fields can always be converted
the default `null: true` property.
Identify (and auto-correct) any field configuration which duplicates
def on_send(node)
def on_send(node) field_config_with_null_true?(node) do |null_config| add_offense(null_config) do |corrector| cleaned_node_source = source_without_keyword_argument(node, null_config) corrector.replace(node.source_range, cleaned_node_source) end end end