Studio reference
Import client APIs from @flexkit/studio. Mount components that use Studio hooks beneath FlexkitStudio; they rely on its project, authentication, routing, and data providers.
Configuration and context
| Export | Purpose |
|---|---|
FlexkitStudio | Render the configured application with config. |
defineConfig, defineEntity | Define project configuration and entities. |
defineExtension | Define a Studio extension with a required id and contributes. |
useConfig | Current project ID/schema, projects, extensions, and contributions. |
useAuth | Signed-in authentication context. |
useAppContext, useAppDispatch | Studio application state, including scope context. |
useCanMutate, canMutateData | UI mutation eligibility; server authorization still applies. |
canAccessSpaces, filterEntitiesForSpaces, filterAttributesForSpaces | Space-aware UI filtering. |
Outlet, useLocation, useParams | Routing inside contributed apps. |
Data hooks
useEntityQuery accepts entity plural name, schema, scope, variables, optional isForm, and selection mode. It returns count/data, loading states, fetchMore, reload, project restriction flags, and a schema-error message. Use its pagination lifecycle rather than guessing completion from a single page.
useEntityMutation returns setters for the run flag, mutation document, and options, followed by result/loading/error and restriction state. It is not the same signature as Apollo’s ordinary mutation hook. Use the installed type declarations when integrating it.
useRefreshEntityList and usePatchEntityList support list refresh/update after changes. useUploadAssets handles application uploads; useSearch supplies mapped search results. Query builders include getEntityQuery, getEntityCreateMutation, getEntityUpdateMutation, getEntityDeleteMutation, and getEntityDeleteWhere.
Types and UI exports
Public types include StudioExtension, StudioContributions, AppOptions, FormFieldProps, Entity, Attribute, Schema, FieldGroup, FormFieldValue, and mapped entity types. The package also exposes table components and selected table/virtualization helpers for custom lists. Use their installed declarations for component props and preserve loading, selection, and accessibility behavior.
See extensions for working registration examples, schema configuration for project options, and compatibility before upgrades.