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

New rule for integration with gql-tag-operations preset of GraphQL-Codegen #915

Open
dotansimha opened this issue Jan 20, 2022 · 3 comments
Labels
new rule waiting-for-answer Waiting for answer from author

Comments

@dotansimha
Copy link
Member

const Doc = gql(/* GraphQL */ `
  query A {
    user {
       id
       login
     }
  }
`)

const MyComponent = () => {
  const data = useQuery(Doc)

   data.id
}

// would raise User.login field is unused in code...
@dimaMachina
Copy link
Collaborator

This rule seems great, but I think this will be impossible without false-positive cases due to props dribbling when we pass data to some child component

@dimaMachina dimaMachina added the waiting-for-answer Waiting for answer from author label Feb 8, 2022
@n1ru4l
Copy link

n1ru4l commented Feb 14, 2022

@B2o5T We can follow it to some extend and recommend people to use fragments for defining component dependencies.

See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md

@n1ru4l
Copy link

n1ru4l commented Feb 20, 2023

See https://github.com/relayjs/eslint-plugin-relay/blob/main/test/unused-fields.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule waiting-for-answer Waiting for answer from author
Development

No branches or pull requests

3 participants