Skip to content

GraphQL/FieldUniqueness and GraphQL Enterprise Changesets #83

@bessey

Description

@bessey

We have just started adopting GraphQL Enterprise Changesets and it seems to conflict with this cop:

class Changesets::FixIdFieldTypes < GraphQL::Enterprise::Changeset
  release "2022-05-16"

  modifies Types::Objects::ExampleType do
    field :id, ID, null: false
  end

  modifies Types::Objects::OtherExampleType do
    field :id, ID, null: false
  end
end

raises

app/graphql/changesets/fix_id_field_types.rb:9:5: C: GraphQL/FieldUniqueness: Field names should only be defined once per type. Field id is duplicated.
    field :id, ID, null: false

It appears to think this is the same file defining the same field twice in a row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions