The API group name (e.g. 'todos').
The endpoint name within the group (e.g. 'list').
Optionalargs: unknownOptional request arguments (params, query, body, headers). Included in the key when provided so that different argument combinations produce distinct cache entries.
A readonly query key array suitable for TanStack Query.
buildQueryKey('todos', 'list');
// ['@cleverbrush', 'todos', 'list']
buildQueryKey('todos', 'list', { query: { page: 2 } });
// ['@cleverbrush', 'todos', 'list', { query: { page: 2 } }]
buildQueryKey('todos', 'get', { params: { id: 42 } });
// ['@cleverbrush', 'todos', 'get', { params: { id: 42 } }]
Builds a query key array for a specific endpoint call.