Documentation
Auth config
Load auth queries and mutations lazily with createBackofficeLazyValue.
Backoffice auth config can lazy-load the Relay operations it needs. This keeps the initial bundle smaller and keeps auth screens independent.
import {
createBackofficeLazyValue,
type BackofficeAuthConfig,
} from '@plumile/backoffice-react';
export const auth: BackofficeAuthConfig = {
: createBackofficeLazyValue(async () => {
const { CurrentSessionQuery } = await import'../queries/CurrentSessionQuery.js';
return {: CurrentSessionQuery };
}),
: createBackofficeLazyValue(async () => {
const [{ LoginPageQuery }, { LoginMutation }] = await Promise.all
import'../queries/LoginPageQuery.js',
import'../mutations/LoginMutation.js',
;
return {
: LoginPageQuery,
: LoginMutation,
};
}),
: createBackofficeLazyValue(async () => {
const { LogoutMutation } = await import'../mutations/LogoutMutation.js';
return {: LogoutMutation };
}),
};Use the same pattern for optional flows such as MFA, passkeys, password reset, invitation acceptance, or email verification.