File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed
language-support/ballerina Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : ballerina-graphql
3
+ description : The Ballerina Standard Library Package for consume GraphQL services.
4
+ url : https://lib.ballerina.io/ballerina/graphql/latest
5
+ github : ballerina-platform/module-ballerina-graphql
6
+ ---
7
+
8
+ To run a ` ballerina-graphql ` client:
9
+
10
+ - Download and install [ Ballerina Language] ( https://ballerina.io/downloads )
11
+ - Then run ` bal run graphql_client.bal ` to run the service, with with this code in the ` graphql_client.bal ` file:
12
+
13
+ ``` ballerina
14
+ import ballerina/graphql;
15
+ import ballerina/io;
16
+
17
+ type Response record {
18
+ record { string hello; } data;
19
+ };
20
+
21
+ public function main() returns error? {
22
+ graphql:Client helloClient = check new ("localhost:9090/graphql");
23
+ string document = "{ hello }";
24
+ Response response = check helloClient->execute(document);
25
+ io:println(response.data.hello);
26
+ }
27
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : ballerina-graphql
3
+ description : The Ballerina Standard Library Package for write GraphQL services.
4
+ url : https://lib.ballerina.io/ballerina/graphql/latest
5
+ github : ballerina-platform/module-ballerina-graphql
6
+ ---
7
+
8
+ To run a ` ballerina-graphql ` hello world server:
9
+
10
+ - Download and install [ Ballerina Language] ( https://ballerina.io/downloads )
11
+ - Then run ` bal run graphql_service.bal ` to run the service, with with this code in the ` graphql_service.bal ` file:
12
+
13
+ ``` ballerina
14
+ import ballerina/graphql;
15
+
16
+ service /graphql on new graphql:Listener(9090) {
17
+ resource function get hello() returns string {
18
+ return "Hello, world!";
19
+ }
20
+ }
21
+ ```
22
+
23
+ ## Features
24
+ - Built with Ballerina ` service ` and ` listener ` model, which are first-class citizens in Ballerina
25
+ - Supports subscriptions over websocket (No additional libraries needed)
26
+ - Supports file upload
27
+ - Built-in GraphiQL client
Original file line number Diff line number Diff line change 1
1
{
2
+ "ballerina" : " Ballerina" ,
2
3
"c-c" : " C / C++" ,
3
4
"c-net" : " C# / .NET" ,
4
5
"clojure" : " Clojure" ,
You can’t perform that action at this time.
0 commit comments