{"id":15192371,"url":"https://github.com/ballerina-platform/module-ballerina-graphql","last_synced_at":"2025-04-12T23:29:31.532Z","repository":{"id":37020082,"uuid":"299201057","full_name":"ballerina-platform/module-ballerina-graphql","owner":"ballerina-platform","description":"The Ballerina GraphQL module is part of the Ballerina Standard Library. It is a spec-compliant, production-ready GraphQL implementation for writing GraphQL APIs in Ballerina.","archived":false,"fork":false,"pushed_at":"2025-04-09T22:40:31.000Z","size":9060,"stargazers_count":141,"open_issues_count":4,"forks_count":64,"subscribers_count":69,"default_branch":"master","last_synced_at":"2025-04-09T23:30:15.907Z","etag":null,"topics":["ballerina","graphql","graphql-client","graphql-federation","graphql-schema","graphql-server","hacktoberfest","integration","library","wso2"],"latest_commit_sha":null,"homepage":"","language":"Ballerina","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ballerina-platform.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-28T05:44:36.000Z","updated_at":"2025-04-09T22:40:34.000Z","dependencies_parsed_at":"2023-01-17T13:45:29.380Z","dependency_job_id":"a41b3fa9-79cd-4f4e-8496-b64585ecbf38","html_url":"https://github.com/ballerina-platform/module-ballerina-graphql","commit_stats":{"total_commits":4457,"total_committers":47,"mean_commits":94.82978723404256,"dds":0.5059457033879291,"last_synced_commit":"008c3c93e8d83e44e3ab54523fe14ec569a6acae"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ballerina-platform","download_url":"https://codeload.github.com/ballerina-platform/module-ballerina-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248646896,"owners_count":21139079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ballerina","graphql","graphql-client","graphql-federation","graphql-schema","graphql-server","hacktoberfest","integration","library","wso2"],"created_at":"2024-09-27T21:22:51.742Z","updated_at":"2025-04-12T23:29:31.510Z","avatar_url":"https://github.com/ballerina-platform.png","language":"Ballerina","funding_links":[],"categories":["Implementations"],"sub_categories":["Ballerina"],"readme":"# Ballerina GraphQL Library\n\n  [![Build](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/build-timestamped-master.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/build-timestamped-master.yml)\n  [![codecov](https://codecov.io/gh/ballerina-platform/module-ballerina-graphql/branch/master/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerina-graphql)\n  [![Trivy](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/trivy-scan.yml)\n  [![GraalVM Check](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-graphql/actions/workflows/build-with-bal-test-graalvm.yml)\n  [![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerina-graphql.svg)](https://github.com/ballerina-platform/module-ballerina-graphql/commits/master)\n  [![Github issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-standard-library/module/graphql.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-standard-library/labels/module%2Fgraphql)\n\n## Overview\n\nThis library provides APIs for connecting and interacting with GraphQL endpoints.\n\nGraphQL is an open-source data query and manipulation language for APIs. GraphQL allows clients to define the structure of the data required and the same structure of the data is returned from the server, preventing the returning of excessively large amounts of data or reducing the number of requests sent to the server.\n\nThe Ballerina GraphQL implementation is using HTTP as the underlying protocol.\n\n## Listener\n\nThe `graphql:Listener` is used to listen to a given IP/Port. To create a `graphql:Listener`, an `http:Listener` or a port number can be used.\n\n### Create a standalone `graphql:Listener`\n\n```ballerina\nimport ballerina/graphql;\n\nlistener graphql:Listener graphqlListener = check new(4000);\n```\n\n### Create a `graphql:Listener` using an `http:Listener`\n\n```ballerina\nimport ballerina/graphql;\nimport ballerina/http;\n\nlistener http:Listener httpListener = check new(4000);\nlistener graphql:Listener graphqlListener = check new(httpListener);\n```\n\n## Service\n\nThe Ballerina GraphQL service represents the GraphQL schema. When a service is attached to a `graphql:Listener`, a GraphQL schema will be auto-generated.\n\nThe GraphQL services are exposed through a single endpoint. The path of the GraphQL service endpoint can be provided via the service path of the GraphQL service. The endpoint of the following Ballerina GraphQL service will be `/graphql`.\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service /graphql on graphqlListener {\n    // ...\n}\n```\n\nThe GraphQL service endpoint URL will be `\u003chost\u003e:\u003cport\u003e/graphql`.\n\nAlternatively, a Ballerina graphql service can not have a path, in which case the endpoint will be the host URL and the port as following example.\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service on graphqlListener {\n    // ...\n}\n```\n\nThe GraphQL service endpoint URL will be `\u003chost\u003e:\u003cport\u003e`\n\nAlternatively, the listener and service initialization can be combined into a single statement as follows:\n\n```ballerina\nservice graphql:Service on new graphql:Listener(9090) {\n\n}\n```\n\n### Query type\n\nThe `resource` functions inside the GraphQL service can represent the resolvers of the `Query` root type.\n\nWhen a `resource` function is defined inside a GraphQL service with the `get` accessor, the generated schema will have a `Query` root type and the `resource` function will be a field of the `Query` object.\n\n\u003e**Note:** A GraphQL service must have at least one resource function defined. Otherwise, it will result in a compilation error.\n\nThe `resource` method must use the `get` accessor for a field to be considered as a `Query` field. The `resource` function name will become the name of the particular field in the GraphQL schema. The return type of the `resource` function will be the type of the corresponding field.\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service /graphql on new graphql:Listener(4000) {\n    resource function get greeting(string name) returns string {\n        return \"Hello, \" + name;\n    }\n}\n```\n\nThe above can be queried using the GraphQL document below:\n\n```graphql\n{\n    greeting(name: \"John\")\n}\n```\n\nThe result will be the following JSON.\n\n```json\n{\n    \"data\": {\n        \"greeting\": \"Hello, John\"\n    }\n}\n```\n\n### Mutation type\n\nThe `remote` functions inside the GraphQL service represent the resolvers of the `Mutation` root type.\n\nWhen a `remote` function is defined inside a GraphQL service, the schema will have a `Mutation` operation and the `remote` function will be a field of the `Mutation` object.\n\nFor example, consider the following service that has a `Person` record named `profile`. It has a `Query` field named `profile`, which returns the `Person` record. It also has two `remote` functions named `updateName` and `updateCity`, which are used as mutations.\n\n```ballerina\nimport ballerina/graphql;\n\npublic type Person record {|\n    string name;\n    int age;\n    string city;\n|};\n\nservice /graphql on new graphql:Listener(4000) {\n    private Person profile;\n\n    function init() {\n        self.profile = { name: \"Walter White\", age: 50, city: \"Albuquerque\" };\n    }\n\n    resource function get profile() returns Person {\n        return self.profile;\n    }\n\n    remote function updateName(string name) returns Person {\n        self.profile.name = name;\n        return self.profile;\n    }\n\n    remote function updateCity(string city) returns Person {\n        self.profile.city = city;\n        return self.profile;\n    }\n}\n```\n\nThis will generate the following schema:\n\n```graphql\ntype Query {\n    profile: Person!\n}\n\ntype Mutation {\n    updateName(name: String!): Person!\n    updateCity(city: String!): Person!\n}\n\ntype Person {\n    name: String!\n    age: Int!\n    city: String!\n}\n```\n\n\u003e**Note:** A GraphQL schema must have a root `Query` type. Therefore, a Ballerina GraphQL service must have at least one `resource` function defined.\n\nThis can be mutated using the following document.\n\n```graphql\nmutation updatePerson {\n    updateName(name: \"Mr. Lambert\") {\n        ... ProfileFragment\n    }\n    updateCity(city: \"New Hampshire\") {\n        ... ProfileFragment\n    }\n}\n\nfragment ProfileFragment on Person {\n    name\n    city\n}\n```\n\n\u003e**Note:** This document uses two mutations and each mutation requests the same fields from the service using a fragment (`ProfileFragment`).\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"updateName\": {\n            \"name\": \"Mr. Lambert\",\n            \"city\": \"Albuquerque\"\n        },\n        \"updateCity\": {\n            \"name\": \"Mr. Lambert\",\n            \"city\": \"New Hampshire\"\n        }\n    }\n}\n```\n\nSee how the result changes the `Person` record. The first mutation changes only the name and it populates the result of the `updateName` field. Then, it will execute the `updateCity` operation and populate the result. This is because the execution of the mutation operations will be done serially in the same order as they are specified in the document.\n\n### Subscription Type\n\nThe subscription type can be used to continuously fetch the data from a GraphQL service.\n\nThe `resource` functions inside the GraphQL service with the `subscribe` accessor can represent the resolvers of the `Subscription` root type.\n\nWhen a `resource` function is defined inside a GraphQL service with the `subscribe` accessor, the generated schema will have a `Subscription` root type and the `resource` function will be a field of the `Subscription` object.\n\nThe `resource` method must use the `subscribe` accessor for a field to be considered as a `Subscription` field. The `resource` function name will become the name of the particular field in the GraphQL schema. The return type of the `resource` function will be the type of the corresponding field.\n\nThe `resource` functions that belong to `Subscription` type must return a stream of `any` type. Any other return type will result in a compilation error.\n\nThe return type\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service /graphql on new graphql:Listener(4000) {\n    resource function subscribe messages() returns stream\u003cstring\u003e {\n        return [\"Walter\", \"Jesse\", \"Mike\"].toStream();\n    }\n}\n```\n\nThe above can be queried using the GraphQL document below:\n\n```graphql\nsubscription {\n    messages\n}\n```\n\nWhen a subscription type is defined, a WebSocket service will be created to call the subscription. The above service\nwill create the service as follows:\n\n```none\nws://\u003chost\u003e:4000/graphql\n```\n\nThis can be accessed using a WebSocket client. When the returned stream has a new entry, it will be broadcast to the subscribers.\n\n## Types\n\nThe Ballerina GraphQL resolver (`resource`/`remote`) methods can return the following types:\n\n### Return types\n\n#### Scalar types\n\nWhen a Ballerina primitive type is returned from a `resource` or a `remote` method, it will be mapped to a GraphQL `NON_NULL` type of the corresponding GraphQL scalar type.\n\nThe following Ballerina types are considered as Scalar types:\n\n* `int`\n* `string`\n* `boolean`\n* `float`\n\n```ballerina\nresource function get greeting() returns string {\n    return \"Hello, World\";\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\n{\n    greeting\n}\n```\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"greeting\": \"Hello, World\"\n    }\n}\n```\n\n#### Enums\n\nWhen a `resource` or a `remote` function returns an `enum` value, it will be mapped to a GraphQL `ENUM` type.\n\n```ballerina\nimport ballerina/graphql;\n\npublic enum Color {\n    RED,\n    GREEN,\n    BLUE\n}\n\nservice on new graphql:Listener(4000) {\n    resource function get color(int code) returns Color {\n        // ...\n    }\n}\n```\n\nThe above service will generate the following GraphQL schema.\n\n```graphql\ntype Query {\n    color: Color!\n}\n\nenum Color {\n    RED\n    GREEN\n    BLUE\n}\n```\n\n#### Record types\n\nWhen a `resource` or `remote` method is returning a `record` type, each field of the record can be queried separately.\nEach `record` type is mapped to a GraphQL `OBJECT` type and the fields of the `record` type are mapped to the fields of the `OBJECT` type.\n\n```ballerina\npublic type Person record {|\n    string name;\n    int age;\n|};\n\nresource function get profile() returns Person {\n    return { name: \"Walter White\", age: 51 };\n}\n```\n\nThis will generate the following schema.\n\n```graphql\ntype Query {\n    profile: Person!\n}\n\ntype Person {\n    name: String!\n    age: Int!\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\n{\n    profile {\n        name\n        age\n    }\n}\n```\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Walter White\",\n            \"age\": 51\n        }\n    }\n}\n```\n\nEach field can be queried separately as shown in the following document:\n\n```graphql\n{\n    profile {\n        name\n    }\n}\n```\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Walter White\"\n        }\n    }\n}\n```\n\n#### Service types\n\nWhen a `resource` function returns a service type, the service type is mapped to a GraphQL `OBJECT` type and the `resource` methods of the service type will be mapped as the fields of the `OBJECT`.\n\nWhen a service type is returned from a `graphql:Service`, the returning service type should also follow the rules of the `graphql:Service` explained above.\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service /graphql on new graphql:Listener(4000) {\n    resource function get profile() returns Person {\n        return new(\"Walter White\", 51);\n    }\n}\n\nservice class Person {\n    private string name;\n    private int age;\n\n    public function init(string name, int age) {\n        self.name = name;\n        self.age = age;\n    }\n\n    resource function get name() returns string =\u003e self.name;\n\n    resource function get age() returns int =\u003e self.age;\n}\n```\n\nThis will generate the following schema:\n\n```graphql\ntype Query {\n    profile: Person!\n}\n\ntype Person {\n    name: String!\n    age: Int!\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\nquery getProfile {\n    profile {\n        name\n    }\n}\n```\n\nThe above will result in the following JSON:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Walter White\"\n        }\n    }\n}\n```\n\n#### Arrays\n\nA GraphQL `resource` function can return an array of the types mentioned above. When a `resource` method returns an array, the corresponding GraphQL field will be the type of `LIST`.\n\n```ballerina\npublic type Person record {|\n    string name;\n    int age;\n|};\n\nresource function get people() returns Person[] {\n    Person p1 = { name: \"Walter White\", age: 51 };\n    Person p2 = { name: \"James Moriarty\", age: 45 };\n    Person p3 = { name: \"Tom Marvolo Riddle\", age: 71 };\n    return [p1, p2, p3];\n}\n```\n\nThis will generate the following schema:\n\n```graphql\ntype Query {\n    profile: [Person!]!\n}\n\ntype Person {\n    name: String!\n    age: Int!\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\n{\n    people {\n        name\n    }\n}\n```\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"people\": [\n            {\n                \"name\": \"Walter White\"\n            },\n            {\n                \"name\": \"James Moriarty\"\n            },\n            {\n                \"name\": \"Tom Marvolo Riddle\"\n            }\n        ]\n    }\n}\n```\n\n\u003e **Note:** Each element in the array consists only of the required `name` field.\n\n#### Nullable types\n\nA Ballerina GraphQL `resource` function can return a union of a type and nil. When a `resource` method returns a union of a type and nil, the corresponding GraphQL field will be of a nullable type.\n\n```ballerina\npublic type Person record {|\n    string name;\n    int age;\n|};\n\nresource function get profile(int id) returns Person? {\n    if (id == 1) {\n        return { name: \"Walter White\", age: 51 };\n    }\n}\n```\n\nThis will generate the following schema:\n\n```graphql\ntype Query {\n    profile: Person\n}\n\ntype Person {\n    name: String!\n    age: Int!\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\n{\n    profile(id: 1) {\n        name\n    }\n}\n```\n\nResult:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Walter White\"\n        }\n    }\n}\n```\n\nIf the following document is used:\n\n```graphql\n{\n    profile(id: 4) {\n        name\n    }\n}\n```\n\nThis will be the result:\n\n```json\n{\n    \"data\": {\n        \"profile\": null\n    }\n}\n```\n\n#### Union types\n\nThe Ballerina GraphQL service can return a union of distinct service types. This will be mapped to a GraphQL `UNION` type.\n\n\u003e **Note:** If a union type is returned directly without providing a type name (`returns T1|T2|T3`), the type name will be `T1_T2_T3`.\n\n```ballerina\nimport ballerina/graphql;\n\npublic type Profile Student|Teacher;\n\nservice /graphql on new graphql:Listener(4000) {\n    resource function get profile(int purity) returns Profile {\n        if (purity \u003c 90) {\n            return new Student(1, \"Jesse Pinkman\");\n        } else {\n            return new Teacher(737, \"Walter White\", \"Chemistry\");\n        }\n    }\n}\n\ndistinct service class Student {\n    private int id;\n    private string name;\n\n    public function init(int id, string name) {\n        self.id = id;\n        self.name = name;\n    }\n\n    resource function get id() returns int {\n        return self.id;\n    }\n\n    resource function get name() returns string {\n        return self.name;\n    }\n}\n\ndistinct service class Teacher {\n    private int id;\n    private string name;\n    private string subject;\n\n    public function init(int id, string name, string subject) {\n        self.id = id;\n        self.name = name;\n        self.subject = subject;\n    }\n\n    resource function get id() returns int {\n        return self.id;\n    }\n\n    resource function get name() returns string {\n        return self.name;\n    }\n\n    resource function get subject() returns string {\n        return self.subject;\n    }\n}\n```\n\nThis will generate the following schema:\n\n```graphql\ntype Query {\n    profile(purity: Int!): Profile!\n}\n\ntype Student {\n    id: Int!\n    name: String!\n}\n\ntype Teacher {\n    id: Int!\n    name: String!\n    subject: String!\n}\n\nunion Profile = Student|Teacher\n```\n\nThis can be queried using the following document:\n\n```graphql\nquery {\n    profile(purity: 75) {\n        ... on Student {\n            name\n        }\n        ... on Teacher {\n            name\n            subject\n        }\n    }\n}\n```\n\nThe result will be:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Jesse Pinkman\"\n        }\n    }\n}\n```\n\nIf the following document is used:\n\n```graphql\nquery {\n    profile(purity: 99) {\n        ... on Student {\n            name\n        }\n        ... on Teacher {\n            name\n            subject\n        }\n    }\n}\n```\n\nThe result will be:\n\n```json\n{\n    \"data\": {\n        \"profile\": {\n            \"name\": \"Walter White\",\n            \"subject\": \"Chemistry\"\n        }\n    }\n}\n```\n\n#### Errors\n\nA Ballerina GraphQL `resource` or `remote` method can return an `error` with the union of the types mentioned above.\n\n\u003e **Note:** A `resource` or a `remote` function cannot return only an `error`, any subtype of an `error`, or, an `error?`, which will result in a compilation error.\n\n```ballerina\npublic type Person record {|\n    string name;\n    int age;\n|};\n\nresource function get profile(int id) returns Person|error {\n    if (id == 1) {\n        return { name: \"Walter White\", age: 51 };\n    } else {\n        return error(string `Invalid ID provided: ${id}`);\n    }\n}\n```\n\nThis can be queried using the following document:\n\n```graphql\n{\n    profile(id: 5) {\n        name\n    }\n}\n```\n\nResult:\n\n```json\n{\n    \"errors\": [\n        {\n            \"message\": \"Invalid ID provided: 5\",\n            \"locations\": [\n                {\n                    \"line\": 2,\n                    \"column\": 4\n                }\n            ]\n        }\n    ]\n}\n```\n\n\u003e **Note:** The error message will be logged to the console and the error will be returned to the client.\n\n### Hierarchical resource paths\n\nA `resource` method inside a GraphQL service can have hierarchical paths.\n\nWhen a hierarchical path is present, each level of the hierarchical path maps to the GraphQL field of the same name, and the type of that field will be mapped to an `OBJECT` type with the same name.\n\n```ballerina\nimport ballerina/graphql;\n\nservice graphql:Service /graphql on new graphq:Listener(4000) {\n    resource function profile/name/first() returns string {\n        return \"Walter\";\n    }\n\n    resource function profile/name/last() returns string {\n        return \"White\"\n    }\n\n    resource function profile/age() returns int {\n        return 51;\n    }\n}\n```\n\nThe above service will create the following schema:\n\n```graphql\ntype Query {\n    profile: profile!\n}\n\ntype profile {\n    name: name!\n    age: Int!\n}\n\ntype name {\n    first: String!\n    last: String!\n}\n```\n\n\u003e **Note:** The field name and the type names are equal.\n\nRefer to the [Ballerina GraphQL specification](https://ballerina.io/spec/graphql) for more information.\n\n## Issues and projects\n\nIssues and Projects tabs are disabled for this repository as this is part of the Ballerina Library. To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Library parent repository](https://github.com/ballerina-platform/ballerina-standard-library).\nThis repository only contains the source code for the module.\n\n## Build from the source\n\n### Prerequisites\n\n1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).\n\n   * [Oracle](https://www.oracle.com/java/technologies/downloads/)\n   * [OpenJDK](https://adoptium.net/)\n\n        \u003e **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.\n\n2. Generate a GitHub access token with read package permissions, then set the following `env` variables:\n\n    ```shell\n   export packageUser=\u003cYour GitHub Username\u003e\n   export packagePAT=\u003cGitHub Personal Access Token\u003e\n    ```\n\n### Build options\n\nExecute the commands below to build from the source.\n\n1. To build the package:\n\n   ```bash\n   ./gradlew clean build\n   ```\n\n2. To run the tests:\n\n   ```bash\n   ./gradlew clean test\n   ```\n\n3. To run a group of tests\n\n   ```bash\n   ./gradlew clean test -Pgroups=\u003ctest_group_names\u003e\n   ```\n\n4. To build the without the tests:\n\n   ```bash\n   ./gradlew clean build -x test\n   ```\n\n5. To debug the package with a remote debugger:\n\n   ```bash\n   ./gradlew clean build -Pdebug=\u003cport\u003e\n   ```\n\n6. To debug with Ballerina language:\n\n   ```bash\n   ./gradlew clean build -PbalJavaDebug=\u003cport\u003e\n   ```\n\n7. Publish the generated artifacts to the local Ballerina central repository:\n\n    ```bash\n    ./gradlew clean build -PpublishToLocalCentral=true\n    ```\n\n8. Publish the generated artifacts to the Ballerina central repository:\n\n   ```bash\n   ./gradlew clean build -PpublishToCentral=true\n   ```\n\n## Contribute to Ballerina\n\nAs an open-source project, Ballerina welcomes contributions from the community.\n\nFor more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).\n\n## Code of conduct\n\nAll the contributors are encouraged to read the [Ballerina Code of Conduct](https://ballerina.io/code-of-conduct).\n\n## Useful links\n\n* For more information go to the [`graphql` library](https://lib.ballerina.io/ballerina/graphql/latest).\n* For the specifications of the package, go to the [Ballerina GraphQL specification](https://ballerina.io/spec/graphql).\n* For example, demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).\n* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).\n* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-graphql/lists"}