Directory components
Directory lib
Standard Hooks
Assists with Table pagination.
pageSize = DEFAULT_PAGE_SIZE ,
meHooks
Handles user auth and other queries related to the current user.
export function useCurrentUserQuery ( { redirectOnNotAuth = true } = {} ) { ... }
export function useSignInMutation () { ... }
export function useSignUpMutation () { ... }
export function useSignOutMutation ( { includeEmailQueryStringParam = false } = {} ) { ... }
export function useMeQuery ( { isAuthenticated = true } = {} ) { ... }
export function useUpdateMeMutation () { ... }
export function useForgotPasswordMutation () { ... }
export function useResetPasswordMutation () { ... }
export function useVerifyAccountMutation () { ... }
Entity Hooks
Hooks are provided for querying the underlying REST API to retrieve and update the database state. To assist with remote state management, these hooks use TanStack Query Queries and Mutations .
useList*Query
Calls the List API and returns a list records.
( { lastEvaluatedKey } ) => axios . get ( ' /widgets ' , {
( { widgetId , lastEvaluatedKey , filter } ) => axios . get ( ` /widgets/ ${ widgetId } /related-widgets ` , {
useSearch*Query
Calls the List API and returns a list of filtered records.
( { lastEvaluatedKey , filter } ) => axios . get ( ' /widgets ' , {
( { widgetId , lastEvaluatedKey , filter } ) => axios . get ( ` /widgets/ ${ widgetId } /related-widgets ` , {
useGet*Query
Calls the Get API and returns an indvidual record.
( { widgetId } ) => axios . get ( ` /widgets/ ${ widgetId } ` )
( { widgetId , relatedWidgetId } ) => axios . get ( ` /widgets/ ${ widgetId } /related-widgets/ ${ relatedWidgetId } ` )
useCreate*Mutation
Calls the Create API and creates a record.
( { data } ) => axios . post ( ' /widgets ' , { widget: data })
( { widgetId , data } ) => axios . post ( ` /widgets/ ${ widgetId } /related-widgets ` , { relatedWidget: data })
useUpdate*Mutation
Calls the Update API and updates a record.
( { widgetId , data } ) => axios . put ( ` /widgets/ ${ widgetId } ` , { widget: data })
( { widgetId , relatedWidgetId , data } ) => axios . put ( ` /widgets/ ${ widgetId } /related-widgets/ ${ relatedWidgetId } ` , { relatedWidget: data })
useDelete*Mutation
Calls the Delete API and deletes a record.
( { widgetId } ) => axios . delete ( ` /widgets/ ${ widgetId } ` )
( { widgetId , relatedWidgetId } ) => axios . delete ( ` /widgets/ ${ widgetId } /related-widgets/ ${ relatedWidgetId } ` )