Skip to content

[svelte-query] Wrong typing generated for options parameter in the hooks method #945

@ymc9

Description

@ymc9

Today query hooks are generated like:

export function useFindManyUser<T extends Prisma.UserFindManyArgs>(
    args?: Prisma.SelectSubset<T, Prisma.UserFindManyArgs>,
    options?: Omit<
        QueryOptions<
            Array<Prisma.UserGetPayload<T> & { $optimistic?: boolean }>
        >,
        'queryKey'
    >,
    optimisticUpdate: boolean = true
);

The QueryOptions type for the options parameter is too generic and is missing a bunch of useful fields like "refetchInterval". We should generate CreateQueryOptions instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions