You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bad. Sad. error is thrown when tried to generate schema using the ballerina graphql service using command line
Steps to Reproduce
Example graphql service. service.bal
importballerina/graphql;
configurableint port =9090;
publictypeUserrecord {|string id;
string name;
|};
service / onnew graphql:Listener(port) {
resourcefunction get user(stringid) returnsUser? {
return {
id:"1",
name:"Jhon",
};
}
}
Command executed.
bal graphql -i service.bal -o schema.graphql
Error:
ballerina: Oh no, something really went wrong. Bad. Sad.
We appreciate it if you can report the code that broke Ballerina in
https://github.com/ballerina-platform/ballerina-lang/issues with the
log you get below and your sample code.
We thank you for helping make us better.
[2024-10-20 20:49:49,395] SEVERE {b7a.log.crash} - The source file '<path>/service.bal' belongs to a Ballerina package.
io.ballerina.projects.ProjectException: The source file '<path>/service.bal' belongs to a Ballerina package.
at io.ballerina.projects.internal.ProjectFiles.validateSingleFileProjectFilePath(ProjectFiles.java:390)
at io.ballerina.projects.internal.PackageConfigCreator.createSingleFileProjectConfig(PackageConfigCreator.java:94)
at io.ballerina.projects.internal.PackageConfigCreator.createSingleFileProjectConfig(PackageConfigCreator.java:109)
at io.ballerina.projects.directory.SingleFileProject.load(SingleFileProject.java:56)
at io.ballerina.projects.directory.ProjectLoader.loadProject(ProjectLoader.java:101)
at io.ballerina.projects.directory.ProjectLoader.loadProject(ProjectLoader.java:41)
at io.ballerina.graphql.schema.generator.SdlSchemaGenerator.generate(SdlSchemaGenerator.java:79)
at io.ballerina.graphql.cmd.GraphqlCmd.generateSchema(GraphqlCmd.java:327)
at io.ballerina.graphql.cmd.GraphqlCmd.executeOperation(GraphqlCmd.java:257)
at io.ballerina.graphql.cmd.GraphqlCmd.execute(GraphqlCmd.java:164)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.ballerina.cli.launcher.Main.main(Main.java:59)
Affected Version(s)
Ballerina 2201.10.1 (Swan Lake Update 10)
Language specification 2024R1
Update Tool 1.4.3
OS, DB, other environment details and versions
OS: Fedora 40
Related area
-> Other Area
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered:
Description
Bad. Sad. error is thrown when tried to generate schema using the ballerina graphql service using command line
Steps to Reproduce
Example graphql service.
service.bal
Command executed.
Error:
Affected Version(s)
Ballerina 2201.10.1 (Swan Lake Update 10)
Language specification 2024R1
Update Tool 1.4.3
OS, DB, other environment details and versions
OS: Fedora 40
Related area
-> Other Area
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: