Son
Son
CCConvex Community
Created by Son on 9/1/2024 in #support-community
Convex Monorepo Issue (react-dom native)
No description
9 replies
CCConvex Community
Created by Son on 6/21/2024 in #support-community
auto incremented int?
Is there a auto incremented int capability that is tracked internally by the database i could use? I don’t want to use a custom v.id, I need a int that increments for every new document added as well as having the standard v.id. Is this possible?
6 replies
CCConvex Community
Created by Son on 6/17/2024 in #support-community
How to use useMutation with convex-ents. API object TYPE error
in my frontend i'm calling this api const storeUser = useMutation(api.users.store); but i get this type error. the function still runs and works as expected. Property 'users' does not exist on type '{ clerkBackend: { AdminGetUserList: FunctionReference<"action", "public", {}, { id: string; email: string | undefined; firstName: string | null; }[] | null>; }; messageActions: { ...; }; }' it cannot find the api because i have replaced... // import { mutation, query } from './_generated/server'; with import { mutation } from './functions'; this is part of my functions.ts
import { entsTableFactory } from 'convex-ents';
import {
customCtx,
customMutation,
customQuery
} from 'convex-helpers/server/customFunctions';
import { GenericDatabaseReader, GenericDatabaseWriter } from 'convex/server';
import { DataModel } from './_generated/dataModel';
import {
internalMutation as baseInternalMutation,
internalQuery as baseInternalQuery,
mutation as baseMutation,
query as baseQuery
} from './_generated/server';
import { entDefinitions } from './schema';
import { MutationCtx } from './types';

type LegacyTables = 'messages' | 'emailList' | 'users';

export const query = customQuery(
baseQuery,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: ctx.db as unknown as GenericDatabaseReader<
Pick<DataModel, LegacyTables>
>
};
})
);

export const mutation = customMutation(
baseMutation,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: ctx.db as GenericDatabaseWriter<Pick<DataModel, LegacyTables>>
};
})
);
import { entsTableFactory } from 'convex-ents';
import {
customCtx,
customMutation,
customQuery
} from 'convex-helpers/server/customFunctions';
import { GenericDatabaseReader, GenericDatabaseWriter } from 'convex/server';
import { DataModel } from './_generated/dataModel';
import {
internalMutation as baseInternalMutation,
internalQuery as baseInternalQuery,
mutation as baseMutation,
query as baseQuery
} from './_generated/server';
import { entDefinitions } from './schema';
import { MutationCtx } from './types';

type LegacyTables = 'messages' | 'emailList' | 'users';

export const query = customQuery(
baseQuery,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: ctx.db as unknown as GenericDatabaseReader<
Pick<DataModel, LegacyTables>
>
};
})
);

export const mutation = customMutation(
baseMutation,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: ctx.db as GenericDatabaseWriter<Pick<DataModel, LegacyTables>>
};
})
);
how can i fix this? As soon as put this back in
`// import { mutation, query } from './_generated/server';
`// import { mutation, query } from './_generated/server';
` everything works.
19 replies
CCConvex Community
Created by Son on 2/7/2024 in #support-community
Best practise for setting user metaData with clerk and convex
would best practise to use an action? i have my convex code in a separate package, that is consumed by my a couple next.js apps. https://clerk.com/docs/users/metadata
6 replies
CCConvex Community
Created by Son on 2/1/2024 in #support-community
Using crypto in convex functions
No description
7 replies
CCConvex Community
Created by Son on 1/31/2024 in #support-community
isAuthenticated is always false (Expo)
No description
47 replies