-
-
Notifications
You must be signed in to change notification settings - Fork 560
Open
Labels
enhancementNew feature or requestNew feature or requestopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Description
Description
Hi, my architectural vision, as well as for example FSD, involves using entities and API slices, the implementation of which requires creating wrapper functions.
Proposal
I suggest implementing a getQueryOptions function that would return a function requiring init and options for the specified method and path.
/* ./entities/sequrity-object/api/query.ts */
export const getSequrityObjectOptions = $api.query.someservice.getQueryOptions('get', '/method');
const Component = () => {
const { data, error, loading } = useQuery(
getSequrityObjectOptions({ params: { testparam: 'test' } }, { enabled: true }),
);
};
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library