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

Support select QueryHookOptions in useQuery #400

Open
gronxb opened this issue Sep 21, 2023 · 0 comments
Open

Support select QueryHookOptions in useQuery #400

gronxb opened this issue Sep 21, 2023 · 0 comments
Labels
🪝 react hooks Feature requests related to React hooks

Comments

@gronxb
Copy link

gronxb commented Sep 21, 2023

Hello, It helps pre-processing by going through the selector from the beginning without going through useMemo.

If you used @tanstack/query, I think it would be a familiar option, and if you have it in apollo, it would be very helpful for pre-processing.

inspired @tanstack/query

const {data: todos} = useQuery(graphql `
      query Todo {
        todos {
          id
          title
        }
      }
    `,
    {
      select: (data) => {
        return data.todos.join();
    }
});

console.log(todo); // expect type: string
@jerelmiller jerelmiller added the 🪝 react hooks Feature requests related to React hooks label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪝 react hooks Feature requests related to React hooks
Projects
None yet
Development

No branches or pull requests

2 participants