Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL/FieldUniqueness and GraphQL Enterprise Changesets #83

Open
bessey opened this issue May 18, 2022 · 1 comment
Open

GraphQL/FieldUniqueness and GraphQL Enterprise Changesets #83

bessey opened this issue May 18, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@bessey
Copy link
Contributor

bessey commented May 18, 2022

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.

@DmitryTsepelev
Copy link
Owner

Hi @bessey! Looks like we just need to handle modifies like we do for arguments nested under different fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants