Skip to content

Hope to export a Client that only exposes queryOptions #2346

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

Open
1 task done
faner11 opened this issue May 30, 2025 · 0 comments
Open
1 task done

Hope to export a Client that only exposes queryOptions #2346

faner11 opened this issue May 30, 2025 · 0 comments
Labels
enhancement New feature or request openapi-react-query Relevant to openapi-react-query

Comments

@faner11
Copy link

faner11 commented May 30, 2025

Description

Currently $api exposes multiple methods such as useQuery, useMutation. In a multi-person team, we hope to use only queryOptions to unify the style.

Proposal

export default function createQueryOptionsClient<Paths extends {}, Media extends MediaType = MediaType>(
  client: FetchClient<Paths, Media>,
): OpenapiQueryClient<Paths, Media> {

  const queryOptions: QueryOptionsFunction<Paths, Media> = (method, path, ...[init, options]) => ({
  });

  return queryOptions;
}

Extra

@faner11 faner11 added enhancement New feature or request openapi-react-query Relevant to openapi-react-query labels May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-react-query Relevant to openapi-react-query
Projects
None yet
Development

No branches or pull requests

1 participant