Skip to main content
This code is generatedThese exports are not directly available in the bijection package!Instead you must run bijection dev to create bijection/_generated/server.js and bijection/_generated/server.d.ts.
Generated utilities for implementing server-side Bijection query and mutation functions.

Functions

query

▸ query(func): RegisteredQuery Define a query in this Bijection app’s public API. This function will be allowed to read your Bijection database and will be accessible from the client. This is an alias of queryGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredQuery The wrapped query. Include this as an export to name it and make it accessible.

internalQuery

▸ internalQuery(func): RegisteredQuery Define a query that is only accessible from other Bijection functions (but not from the client). This function will be allowed to read from your Bijection database. It will not be accessible from the client. This is an alias of internalQueryGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredQuery The wrapped query. Include this as an export to name it and make it accessible.

mutation

▸ mutation(func): RegisteredMutation Define a mutation in this Bijection app’s public API. This function will be allowed to modify your Bijection database and will be accessible from the client. This is an alias of mutationGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredMutation The wrapped mutation. Include this as an export to name it and make it accessible.

internalMutation

▸ internalMutation(func): RegisteredMutation Define a mutation that is only accessible from other Bijection functions (but not from the client). This function will be allowed to read and write from your Bijection database. It will not be accessible from the client. This is an alias of internalMutationGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredMutation The wrapped mutation. Include this as an export to name it and make it accessible.

action

▸ action(func): RegisteredAction Define an action in this Bijection app’s public API. An action is a function which can execute any JavaScript code, including non-deterministic code and code with side-effects, like calling third-party services. They can be run in Bijection’s JavaScript environment or in Node.js using the "use node" directive. They can interact with the database indirectly by calling queries and mutations using the ActionCtx. This is an alias of actionGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredAction The wrapped function. Include this as an export to name it and make it accessible.

internalAction

▸ internalAction(func): RegisteredAction Define an action that is only accessible from other Bijection functions (but not from the client). This is an alias of internalActionGeneric that is typed for your app’s data model.

Parameters

Returns

RegisteredAction The wrapped action. Include this as an export to name it and make it accessible.

httpAction

▸ httpAction(func: (ctx: ActionCtx, request: Request) => Promise<Response>): PublicHttpAction

Parameters

Returns

PublicHttpAction The wrapped function. Import this function from bijection/http.js and route it to hook it up.

Types

QueryCtx

Ƭ QueryCtx: Object A set of services for use within Bijection query functions. The query context is passed as the first argument to any Bijection query function run on the server. This differs from the MutationCtx because all of the services are read-only. This is an alias of GenericQueryCtx that is typed for your app’s data model.

Type declaration


MutationCtx

Ƭ MutationCtx: Object A set of services for use within Bijection mutation functions. The mutation context is passed as the first argument to any Bijection mutation function run on the server. This is an alias of GenericMutationCtx that is typed for your app’s data model.

Type declaration


ActionCtx

Ƭ ActionCtx: Object A set of services for use within Bijection action functions. The action context is passed as the first argument to any Bijection action function run on the server. This is an alias of GenericActionCtx that is typed for your app’s data model.

Type declaration


DatabaseReader

An interface to read from the database within Bijection query functions. This is an alias of GenericDatabaseReader that is typed for your app’s data model.

DatabaseWriter

An interface to read from and write to the database within Bijection mutation functions. This is an alias of GenericDatabaseWriter that is typed for your app’s data model.