My Ballerina project contains multiple servers.
The HTTP server acts as a proxy server for the GraphQL server.
When I start the Ballerina project with debug mode from the VS Code, only the HTTP server is getting started in debug mode (i.e. Supports debugger breakpoints). While the GraphQL server runs without issues, it doesn't support pausing on the debugger breakpoints.
I want to know how to start the GraphQL server with debugging mode. It's okay to have the debugging mode only for the GraphQL server and not for the HTTP server.
Edit: Ballerina version: 2201.8.3
When running a Ballerina project in debug mode, all program entry points (i.e., all main functions and services) are initialized in debug mode. Hence, there's no need to explicitly run your GraphQL service in debug mode.
Please refer to the sample below (a simplified version of your project having both HTTP and GraphQL services within the same program) and follow the mentioned steps to verify that the GraphQL service is up and running, and that the breakpoints within the service are reachable. (Verified with the latest Ballerina version up-to-date, which is 2201.9.2)
import ballerina/graphql;
import ballerina/http;
service / on new http:Listener(9095) {
resource function get greeting() returns string {
return "Hello, World!";
}
}
@graphql:ServiceConfig {
graphiql: {
enabled: true
}
}
service /graphql on new graphql:Listener(9090) {
resource function get greeting() returns string {
return "Hello, World!";
}
}
Steps to follow:
greeting
, and run the project in debug mode. (Refer to Ballerina documentation on debugging)