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

Spike: Why is select needed on ingredient parts for getting recipe #571

Open
Andreasgdp opened this issue Oct 14, 2023 · 0 comments
Open

Comments

@Andreasgdp
Copy link
Member

Figure out why it is nessesary to use select avoiding getting the assignedAt field Types of property assignedAt are incompatible.
Type is Date not assignable to type string

ingredients: {
select: {
ingredient: true,
quantity: true,
},

Might be to a trpc bug with inconsistent types between Awaited< ReturnType<(typeof serverClient)['recipe']['getPublicRecipe']> and const recipe = trpc.recipe.getPublicRecipe.useQuery(
{ id },
{
initialData: initialRecipe,
refetchOnMount: false,
refetchOnReconnect: false,
}
);
In recipeView.tsx:

const recipe = trpc.recipe.getPublicRecipe.useQuery(
{ id },
{
initialData: initialRecipe,
refetchOnMount: false,
refetchOnReconnect: false,
}
);

@Andreasgdp Andreasgdp changed the title Why is select needed on ingredient parts for getting recipe Spike: Why is select needed on ingredient parts for getting recipe Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Product Backlog
Development

No branches or pull requests

1 participant