@@ -25,7 +25,10 @@ import { JSONRPCPlugin } from '@objectql/protocol-json-rpc';
2525import { HonoServerPlugin } from '@objectstack/plugin-hono-server' ;
2626import { AuthPlugin } from '@objectstack/plugin-auth' ;
2727import { ConsolePlugin } from '@object-ui/console' ;
28- import { ObjectQLPlugin } from '@objectql/core' ;
28+ import { ObjectQLPlugin } from '@objectstack/objectql' ;
29+ import { QueryPlugin } from '@objectql/plugin-query' ;
30+ import { ValidatorPlugin } from '@objectql/plugin-validator' ;
31+ import { FormulaPlugin } from '@objectql/plugin-formula' ;
2932import { createApiRegistryPlugin } from '@objectstack/core' ;
3033import { MemoryDriver } from '@objectql/driver-memory' ;
3134import * as fs from 'fs' ;
@@ -55,6 +58,10 @@ function loadObjects(dir: string) {
5558
5659const projectTrackerDir = path . join ( __dirname , 'examples/showcase/project-tracker/src' ) ;
5760
61+ // Shared driver instance — registered as 'driver.default' service for
62+ // upstream ObjectQLPlugin discovery and passed to QueryPlugin for query execution.
63+ const defaultDriver = new MemoryDriver ( ) ;
64+
5865export default {
5966 metadata : {
6067 name : 'objectos' ,
@@ -66,25 +73,30 @@ export default {
6673 createApiRegistryPlugin ( ) ,
6774 new HonoServerPlugin ( { } ) ,
6875 new ConsolePlugin ( ) ,
69- new ObjectQLPlugin ( {
70- enableRepository : true ,
71- enableQueryService : true ,
72- // Validator and Formula plugins are included by default
73- enableValidator : true ,
74- enableFormulas : true ,
75- datasources : {
76- default : new MemoryDriver ( )
77- }
78- } ) ,
76+ // Register MemoryDriver as 'driver.default' service so upstream
77+ // ObjectQLPlugin can discover it during start() phase.
78+ {
79+ name : 'driver-memory' ,
80+ init : async ( ctx : any ) => {
81+ ctx . registerService ( 'driver.default' , defaultDriver ) ;
82+ } ,
83+ start : async ( ) => { } ,
84+ } ,
85+ // Upstream ObjectQLPlugin from @objectstack /objectql:
86+ // - Registers objectql, metadata, data, protocol services
87+ // - Discovers driver.* and app.* services (fixes auth plugin object registration)
88+ // - Registers audit hooks (created_by/updated_by) and tenant isolation middleware
89+ new ObjectQLPlugin ( ) ,
90+ new QueryPlugin ( { datasources : { default : defaultDriver } } ) ,
91+ new ValidatorPlugin ( ) ,
92+ new FormulaPlugin ( ) ,
7993 new ObjectQLSecurityPlugin ( {
8094 enableAudit : false
8195 } ) ,
8296 new AuthPlugin ( {
8397 secret : process . env . AUTH_SECRET || 'objectql-dev-secret-change-me-in-production' ,
8498 trustedOrigins : [ 'http://localhost:*' ] ,
8599 } ) ,
86- // ValidatorPlugin is managed by ObjectQLPlugin now
87- // new ValidatorPlugin(),
88100 new GraphQLPlugin ( {
89101 basePath : '/graphql' ,
90102 introspection : true ,
0 commit comments