Skip to content

v0.4.2

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Oct 19:13
753d7e0

Patch Changes

  • df53a30: Add support for custom mutation builders in createClient and createApi. Both functions now accept an optional internalMutation parameter, allowing you to wrap internal mutations with custom context (e.g., triggers, aggregates, middleware).

    Usage:

    const internalMutation = customMutation(
      internalMutationGeneric,
      customCtx(async (ctx) => ({
        db: triggers.wrapDB(ctx).db,
      }))
    );
    
    // Pass to createClient
    createClient({
      authFunctions,
      schema,
      internalMutation,
      triggers,
    });
    
    // Pass to createApi
    createApi(schema, {
      ...auth.options,
      internalMutation,
    });