import { createTanstackQueryUtils } from '@orpc/tanstack-query' import { orpc as orpcClient } from './orpc.client' export const orpc = createTanstackQueryUtils(orpcClient, { experimental_defaults: { todo: { create: { mutationOptions: { onSuccess: (_, __, ___, ctx) => { ctx.client.invalidateQueries({ queryKey: orpc.todo.list.key() }) }, }, }, update: { mutationOptions: { onSuccess: (_, __, ___, ctx) => { ctx.client.invalidateQueries({ queryKey: orpc.todo.list.key() }) }, }, }, remove: { mutationOptions: { onSuccess: (_, __, ___, ctx) => { ctx.client.invalidateQueries({ queryKey: orpc.todo.list.key() }) }, }, }, }, }, })