Skip to content

Commit a7ba4a1

Browse files
Copilothotlong
andcommitted
refactor: remove console.log/warn calls from GraphQL protocol plugin
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent c4de28d commit a7ba4a1

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

packages/protocols/graphql/src/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,10 @@ export class GraphQLPlugin implements RuntimePlugin {
166166
* Install hook - called during kernel initialization
167167
*/
168168
async install(ctx: RuntimeContext): Promise<void> {
169-
console.log(`[${this.name}] Installing GraphQL protocol plugin...`);
170169
this.ctx = ctx;
171170

172171
// Store reference to the engine for later use
173172
this.engine = ctx.engine || (ctx as any).getKernel?.();
174-
175-
console.log(`[${this.name}] Protocol bridge initialized`);
176173
}
177174

178175
/**
@@ -198,13 +195,10 @@ export class GraphQLPlugin implements RuntimePlugin {
198195
}
199196

200197
if (httpServer && httpServer.app) {
201-
console.log(`[${this.name}] Attaching to existing Hono server...`);
202198
await this.attachToHono(httpServer.app);
203199
return;
204200
}
205201

206-
console.log(`[${this.name}] Starting GraphQL server with subscriptions (Standalone)...`);
207-
208202
// Generate schema from metadata
209203
const typeDefs = this.generateSchema();
210204
const resolvers = this.generateResolvers();
@@ -220,7 +214,6 @@ export class GraphQLPlugin implements RuntimePlugin {
220214
resolvers
221215
}
222216
]);
223-
console.log(`[${this.name}] 🔗 Apollo Federation enabled - service: ${this.config.federationServiceName}`);
224217
} else {
225218
// Build standard GraphQL schema
226219
schema = makeExecutableSchema({
@@ -310,13 +303,6 @@ export class GraphQLPlugin implements RuntimePlugin {
310303
// Start HTTP server
311304
await new Promise<void>((resolve) => {
312305
this.httpServer.listen(this.config.port, () => {
313-
console.log(`[${this.name}] 🚀 GraphQL server ready at: http://localhost:${this.config.port}/graphql`);
314-
if (this.config.introspection) {
315-
console.log(`[${this.name}] 📊 Apollo Sandbox available at: http://localhost:${this.config.port}/graphql`);
316-
}
317-
if (this.config.enableSubscriptions) {
318-
console.log(`[${this.name}] 🔌 WebSocket subscriptions ready at: ws://localhost:${this.config.port}/graphql`);
319-
}
320306
resolve();
321307
});
322308
});
@@ -393,18 +379,12 @@ export class GraphQLPlugin implements RuntimePlugin {
393379
}
394380
});
395381

396-
console.log(`[${this.name}] 🚀 GraphQL mounted at /graphql`);
397-
if (this.config.introspection) {
398-
console.log(`[${this.name}] 📊 Apollo Sandbox available at /graphql`);
399-
}
400382
}
401383

402384
/**
403385
* Stop hook - called when kernel stops
404386
*/
405387
async onStop(ctx: RuntimeContext): Promise<void> {
406-
console.log(`[${this.name}] Stopping GraphQL server...`);
407-
408388
if (this.server) {
409389
await this.server.stop();
410390
this.server = undefined;
@@ -1504,7 +1484,6 @@ export class GraphQLPlugin implements RuntimePlugin {
15041484

15051485
const graphqlType = typeMap[fieldType];
15061486
if (!graphqlType) {
1507-
console.warn(`[GraphQLPlugin] Unknown field type '${fieldType}', defaulting to String`);
15081487
return 'String';
15091488
}
15101489

0 commit comments

Comments
 (0)