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

{namespace}Context default queryOptions modification #194

Open
unrealsolver opened this issue Aug 17, 2023 · 0 comments
Open

{namespace}Context default queryOptions modification #194

unrealsolver opened this issue Aug 17, 2023 · 0 comments

Comments

@unrealsolver
Copy link

Have a question. Am I suppose to modify this function in order to have default query options?

/**
 * Context injected into every react-query hook wrappers
 *
 * @param queryOptions options from the useQuery wrapper
 */
export function useNamespaceContext<
  TQueryFnData = unknown,
  TError = unknown,
  TData = TQueryFnData,
  TQueryKey extends QueryKey = QueryKey
>(
  _queryOptions?: Omit<
    UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
    'queryKey' | 'queryFn'
  >
): UvrmContext {
  return {
    fetcherOptions: {},
    queryOptions: {},
    queryKeyFn,
  };
}

Also, the type definition type NamespaceContext only has enabled property. So, I guess, I can not use for example retry there unless I change the type definition.

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