Open History to see the last commit
1/* eslint-disable */
2/**
3 * Generated utilities for implementing server-side Convex query and mutation functions.
4 *
5 * THIS CODE IS AUTOMATICALLY GENERATED.
6 *
7 * To regenerate, run `npx convex dev`.
8 * @module
9 */
10β
11import {
12 actionGeneric,
13 httpActionGeneric,
14 queryGeneric,
15 mutationGeneric,
16 internalActionGeneric,
17 internalMutationGeneric,
18 internalQueryGeneric,
19} from 'convex/server'
20β
21/**
22 * Define a query in this Convex app's public API.
23 *
24 * This function will be allowed to read your Convex database and will be accessible from the client.
25 *
26 * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
27 * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
28 */
29export const query = queryGeneric
30β
31/**
32 * Define a query that is only accessible from other Convex functions (but not from the client).
33 *
34 * This function will be allowed to read from your Convex database. It will not be accessible from the client.
35 *
36 * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
37 * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
38 */
39export const internalQuery = internalQueryGeneric
40β
41/**
42 * Define a mutation in this Convex app's public API.
43 *
44 * This function will be allowed to modify your Convex database and will be accessible from the client.
45 *
46 * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
47 * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
48 */
49export const mutation = mutationGeneric
50β
51/**
52 * Define a mutation that is only accessible from other Convex functions (but not from the client).
53 *
54 * This function will be allowed to modify your Convex database. It will not be accessible from the client.
55 *
56 * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
57 * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
58 */
59export const internalMutation = internalMutationGeneric
60β
61/**
62 * Define an action in this Convex app's public API.
63 *
64 * An action is a function which can execute any JavaScript code, including non-deterministic
65 * code and code with side-effects, like calling third-party services.
66 * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
67 * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
68 *
69 * @param func - The action. It receives an {@link ActionCtx} as its first argument.
70 * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
71 */
72export const action = actionGeneric
73β
74/**
75 * Define an action that is only accessible from other Convex functions (but not from the client).
76 *
77 * @param func - The function. It receives an {@link ActionCtx} as its first argument.
78 * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
79 */
80export const internalAction = internalActionGeneric
81β
82/**
83 * Define a Convex HTTP action.
84 *
85 * @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
86 * as its second.
87 * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
88 */
89export const httpAction = httpActionGeneric