beerman
CCConvex Community
•Created by beerman on 1/21/2025 in #support-community
Not getting indexRange callback type
Hey all, I'm having an issue with one of my queries where the type of
q
inside withIndex
is not being inferred.
Did I miss something?
6 replies
CCConvex Community
•Created by beerman on 1/18/2025 in #support-community
getting type of query
+page.svelte
component
FunctionReturnType<api.accounts.list>
returns the type of the data but doesn't include the query states. And UsePaginatedQueryReturnType<api.accounts.list>
creates a type mismatch.
What's the correct way to do this?4 replies
CCConvex Community
•Created by beerman on 1/17/2025 in #support-community
Type Mismatch in Update Mutation with Optional Fields
I’m running into a type mismatch issue when updating an account using a mutation. Simplified version of my setup:
schema.ts
accounts.ts
component
Error
Types of property 'name' are incompatible.• In the mutation, I’ve excluded the type field and allowed the remaining fields to be updated. • The handleUpdateAccount function uses Partial so only the fields that need updating are passed. • I suspect the issue is that the mutation expects all fields to be required, but I’m passing optionals. Is there a proper way to define the mutation to accept optional fields without manually marking each field as optional? Should I adjust the schema or is there a better solution to handle partial updates?
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
3 replies
CCConvex Community
•Created by beerman on 10/5/2024 in #support-community
a little confused about getManyVia
Hey all, I have a table
features
which stores different feature options and joiner table property_features
which connects the features to properties and has an additional details
field for property specific information per feature.
I'm trying to get all the property features (name, as well as the details), so I thought that getManyVia would be the best option to use, but I'm only getting the names but not the details. Have I misunderstood how this works?
extract from schema
query
2 replies
CCConvex Community
•Created by beerman on 10/3/2024 in #support-community
unable to query relation with getOneFrom helper
4 replies
CCConvex Community
•Created by beerman on 10/1/2024 in #support-community
struggling with mutation
I'm trying to infer a type from my schema in order to type locationData which I will pass to the mutation but I keep getting the following error:
src/convex/addCompleteProperty.ts|7 col 23-62 error| Type 'TableDefinition<VObject<{ district?: string | undefined; city?: string | undefined; area?: string | undefined; postal_code?: string | undefined; nearest_landmark?: string | undefined; latitude?: number | undefined; longitude?: number | undefined; country: string; province: string; address: string; }, { ...; }, "requ...' does not satisfy the constraint 'Validator<any, OptionalProperty, any>'.Here's the relevant section of my schema Where did I go wrong?
238 replies