{"id":24754036,"url":"https://github.com/excitement-engineer/graphql-klient","last_synced_at":"2026-04-17T01:31:35.499Z","repository":{"id":66169683,"uuid":"177274814","full_name":"excitement-engineer/graphql-klient","owner":"excitement-engineer","description":"A simple to use graphQL client for kotlin","archived":false,"fork":false,"pushed_at":"2020-05-08T21:17:46.000Z","size":67,"stargazers_count":1,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T05:13:10.471Z","etag":null,"topics":["client","graphql","kotlin"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/excitement-engineer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-23T10:23:49.000Z","updated_at":"2020-04-10T18:36:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7883211b-4133-44df-903a-8c31da49d87f","html_url":"https://github.com/excitement-engineer/graphql-klient","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/excitement-engineer/graphql-klient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excitement-engineer%2Fgraphql-klient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excitement-engineer%2Fgraphql-klient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excitement-engineer%2Fgraphql-klient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excitement-engineer%2Fgraphql-klient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/excitement-engineer","download_url":"https://codeload.github.com/excitement-engineer/graphql-klient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excitement-engineer%2Fgraphql-klient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31911440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["client","graphql","kotlin"],"created_at":"2025-01-28T11:38:51.305Z","updated_at":"2026-04-17T01:31:35.467Z","avatar_url":"https://github.com/excitement-engineer.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Klient\n\nAn easy to use GraphQL client for Kotlin.\n\n## Installation\n\n## Maven\n\nAdd bintray repository:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ebintray-excitement-engineer-graphql-klient\u003c/id\u003e\n        \u003cname\u003ebintray\u003c/name\u003e\n        \u003curl\u003ehttps://dl.bintray.com/excitement-engineer/graphql-klient\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nAdd dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.excitement-engineer\u003c/groupId\u003e\n    \u003cartifactId\u003egraphql-klient\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Gradle\n\nAdd bintray repository:\n\n```\nrepositories {\n    maven {\n        url  \"https://dl.bintray.com/excitement-engineer/graphql-klient\"\n    }\n}\n```\n\nAdd dependency:\n\n```\ncompile 'com.github.excitement-engineer:graphql-klient:{version}'\n```\n\n## Quickstart\n\nIn order to make requests to a graphQL server we first need to defined a `GraphQLClient`.\n\n```kt\nval client = GraphQLClient(\"http://example.com/graphql)\n```\n\nNext we define data classes corresponding to the query\n\n```kt\ndata class Response(\n    user: User\n)\n\ndata class User(\n    val id: String,\n    val name: String\n)\n```\n\nFinally we make the request\n\n```kt\n\nval query = \"\"\"\n   {\n        user {\n            id\n            name\n        }\n   }\n\"\"\"\n\nval request = GraphQLRequest(query)\n\nval response = client.performRequest\u003cResponse\u003e(request)\n\n// Retrieve the data\nprintln(response.data?.user)\n\n// Check for any errors\nif (response.hasErrors) {\n    println(response.errors)\n}\n```\n\n\n## Examples\n\n### Authentication via HTTP header\n\n\n```kt\nval client = GraphQLClient(\n    endpoint = \"http://example.com/graphql\",\n    headers = mapOf(\n        \"Authorization\" to \"Bearer TOKEN\"\n    )\n)\n\nval query = \"\"\"\n   {\n        user {\n            id\n            name\n        }\n   }\n\"\"\"\n\nval request = GraphQLRequest(query)\n\nval response = client.performRequest\u003cResponse\u003e(request)\n```\n\n### Using variables\n\n```kt\nval client = GraphQLClient(\"http://example.com/graphql\")\n\nval query = \"\"\"\n    query getUser($id: ID!) {\n        user(id: $id) {\n            id\n            name\n        }\n    }\n\"\"\"\n\nval request = GraphQLRequest(\n    query = query,\n    variables = mapOf(\n        \"id\" to \"1\"\n    )\n)\n\nval response = client.performRequest\u003cResponse\u003e(request)\n```\n\n### Using an operation name\n\n```kt\nval client = GraphQLClient(\"http://example.com/graphql\")\n\nval query = \"\"\"\n    query singleUser {\n        user {\n            id\n            name\n        }\n    }\n\n    query allUsers {\n        users {\n            id\n            name\n        }\n    }\n\"\"\"\n\nval response = client.performRequest\u003cResponse\u003e(\n        GraphQLRequest(\n            query = query,\n            operationName = \"singleUser\"\n        )\n    )\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcitement-engineer%2Fgraphql-klient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcitement-engineer%2Fgraphql-klient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcitement-engineer%2Fgraphql-klient/lists"}