Skip to content

Commit d93d1b5

Browse files
Copilothotlong
andcommitted
Address code review feedback: clarify route comment, document GraphQL convention, remove type assertion
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 2d9c5c8 commit d93d1b5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/objectql/src/protocol-discovery.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ describe('ObjectStackProtocolImplementation - Dynamic Service Discovery', () =>
144144
protocol = new ObjectStackProtocolImplementation(engine, () => mockServices);
145145
const discovery = await protocol.getDiscovery();
146146

147-
// capabilities field should no longer exist
148-
expect((discovery as any).capabilities).toBeUndefined();
147+
// capabilities field should no longer exist in the response
148+
const keys = Object.keys(discovery);
149+
expect(keys).not.toContain('capabilities');
149150
// Use services to check availability instead
150151
expect(discovery.services.workflow.enabled).toBe(true);
151152
});

packages/objectql/src/protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const SERVICE_CONFIG: Record<string, { route: string; plugin: string }> = {
4343
notification: { route: '/api/v1/notifications', plugin: 'plugin-notifications' },
4444
ai: { route: '/api/v1/ai', plugin: 'plugin-ai' },
4545
i18n: { route: '/api/v1/i18n', plugin: 'plugin-i18n' },
46-
graphql: { route: '/graphql', plugin: 'plugin-graphql' },
46+
graphql: { route: '/graphql', plugin: 'plugin-graphql' }, // GraphQL uses /graphql by convention (not versioned REST)
4747
'file-storage': { route: '/api/v1/storage', plugin: 'plugin-storage' },
4848
search: { route: '/api/v1/search', plugin: 'plugin-search' },
4949
};

packages/spec/src/api/discovery.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const DiscoverySchema = z.object({
107107
version: z.string(),
108108
environment: z.enum(['production', 'sandbox', 'development']),
109109

110-
/** Dynamic Routing — convenience shortcut derived from services */
110+
/** Dynamic Routing — convenience shortcut for client routing */
111111
routes: ApiRoutesSchema,
112112

113113
/** Localization Info (helping frontend init i18n) */

0 commit comments

Comments
 (0)