/** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ import { useQuery } from '@tanstack/react-query'; import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; import { getClient } from '../client'; import { buildListSelectionArgs } from '../selection'; import type { ListSelectionConfig } from '../selection'; import { pubkeySettingKeys } from '../query-keys'; import type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingFilter, PubkeySettingOrderBy, } from '../../orm/input-types'; import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect, } from '../../orm/select-types'; export type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingFilter, PubkeySettingOrderBy, } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const pubkeySettingsQueryKey = pubkeySettingKeys.list; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing * * @example * ```tsx * const { data, isLoading } = usePubkeySettingsQuery({ * selection: { * fields: { id: true, name: true }, * where: { name: { equalTo: "example" } }, * orderBy: ['CREATED_AT_DESC'], * first: 10, * }, * }); * ``` */ export function usePubkeySettingsQuery< S extends PubkeySettingSelect, TData = { pubkeySettings: ConnectionResult>; }, >( params: { selection: { fields: S; } & Omit, 'fields'> & HookStrictSelect, PubkeySettingSelect>; } & Omit< UseQueryOptions< { pubkeySettings: ConnectionResult>; }, Error, TData >, 'queryKey' | 'queryFn' > ): UseQueryResult; export function usePubkeySettingsQuery( params: { selection: ListSelectionConfig; } & Omit, 'queryKey' | 'queryFn'> ) { const args = buildListSelectionArgs< PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy >(params.selection); const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: pubkeySettingKeys.list(args), queryFn: () => getClient().pubkeySetting.findMany(args).unwrap(), ...queryOptions, }); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing * * @example * ```ts * const data = await fetchPubkeySettingsQuery({ * selection: { * fields: { id: true }, * first: 10, * }, * }); * ``` */ export async function fetchPubkeySettingsQuery(params: { selection: { fields: S; } & Omit, 'fields'> & HookStrictSelect, PubkeySettingSelect>; }): Promise<{ pubkeySettings: ConnectionResult>; }>; export async function fetchPubkeySettingsQuery(params: { selection: ListSelectionConfig; }) { const args = buildListSelectionArgs< PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy >(params.selection); return getClient().pubkeySetting.findMany(args).unwrap(); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing * * @example * ```ts * await prefetchPubkeySettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ export async function prefetchPubkeySettingsQuery( queryClient: QueryClient, params: { selection: { fields: S; } & Omit, 'fields'> & HookStrictSelect, PubkeySettingSelect>; } ): Promise; export async function prefetchPubkeySettingsQuery( queryClient: QueryClient, params: { selection: ListSelectionConfig; } ): Promise { const args = buildListSelectionArgs< PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy >(params.selection); await queryClient.prefetchQuery({ queryKey: pubkeySettingKeys.list(args), queryFn: () => getClient().pubkeySetting.findMany(args).unwrap(), }); }