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

relay/generated-flow-types not working with useMutation hooks #154

Open
zygopleural opened this issue Nov 29, 2024 · 0 comments
Open

relay/generated-flow-types not working with useMutation hooks #154

zygopleural opened this issue Nov 29, 2024 · 0 comments

Comments

@zygopleural
Copy link

zygopleural commented Nov 29, 2024

Code setup as follows:

...

import type { DashboardPageUserViewedDashboardMutation } from "./__generated__/DashboardPageUserViewedDashboardMutation.graphql"

...

export default function DashboardPage() {
  ...
  
  const [userViewedDashboardMutation] =
    useMutation<DashboardPageUserViewedDashboardMutation>(graphql`
      mutation DashboardPageUserViewedDashboardMutation {
        userViewedDashboard {
          viewedDashboard
        }
      }
    `)

  ...
  
}

...

Setting "relay/generated-flow-types": "error"

Gives the following issue:

Screenshot 2024-11-29 at 15 00 33

I see a test case for the failure condition here https://github.com/relayjs/eslint-plugin-relay/blob/main/test/generated-typescript-types.js#L538-L552 but no corresponding passing condition test.

From what I can see in the source code here https://github.com/relayjs/eslint-plugin-relay/blob/main/src/rule-generated-flow-types.js#L567-L583 what I have should not be an issue.

Looks like this was added by @tyao1 via 3d1ebcd so maybe they can advise.

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

No branches or pull requests

1 participant