{"id":15043127,"url":"https://github.com/qgadrian/graphito","last_synced_at":"2026-03-03T05:33:24.387Z","repository":{"id":57503205,"uuid":"132497574","full_name":"qgadrian/graphito","owner":"qgadrian","description":"GraphQL client for Elixir","archived":false,"fork":false,"pushed_at":"2025-01-23T11:55:22.000Z","size":54,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T05:19:20.953Z","etag":null,"topics":["elixir","elixir-library","graphql","graphql-client","hex"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qgadrian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-05-07T17:59:45.000Z","updated_at":"2025-01-23T11:55:26.000Z","dependencies_parsed_at":"2025-04-14T21:12:43.873Z","dependency_job_id":"baeb4c55-9c9b-489e-b40b-ae97ffd5afd4","html_url":"https://github.com/qgadrian/graphito","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/qgadrian/graphito","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgadrian%2Fgraphito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgadrian%2Fgraphito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgadrian%2Fgraphito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgadrian%2Fgraphito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qgadrian","download_url":"https://codeload.github.com/qgadrian/graphito/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgadrian%2Fgraphito/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268385711,"owners_count":24242100,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["elixir","elixir-library","graphql","graphql-client","hex"],"created_at":"2024-09-24T20:48:36.491Z","updated_at":"2026-03-03T05:33:24.348Z","avatar_url":"https://github.com/qgadrian.png","language":"Elixir","readme":"[![Coverage Status](https://coveralls.io/repos/github/qgadrian/graphito/badge.svg?branch=master)](https://coveralls.io/github/qgadrian/graphito?branch=master)\n[![Hex version](https://img.shields.io/hexpm/v/sippet.svg \"Hex version\")](https://hex.pm/packages/graphito)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/graphito)\n[![Build Status](https://travis-ci.org/qgadrian/graphito.svg?branch=master)](https://travis-ci.org/qgadrian/graphito.svg?branch=master)\n[![Deps Status](https://beta.hexfaktor.org/badge/all/github/qgadrian/graphito.svg)](https://beta.hexfaktor.org/github/qgadrian/graphito)\n\n# Graphito\n\n[GraphQL](https://graphql.org/) client for Elixir.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n\n## Installation\n\nAdd to dependencies in your `mix.exs` file...\n\n```elixir\ndef deps do\n  [{:graphito, \"~\u003e 0.2.0\"}]\nend\n```\n\n...and run:\n\n```bash\nmix deps.get\n```\n\n## Configuration\n\nYou will have to configure a url for the GraphQL server.\n\n```elixir\nconfig :graphito,\n  url: \"a_graphql_host\"\n```\n\nAdditionally, headers can be configured and they will be sent in all requests.\n\n```elixir\nconfig :graphito,\n  headers: [{\"this_header\", \"is_always_sent\"}]\n```\n\n## Usage\n\nRun any GraphQL operation (a query or mutation):\n\n```elixir\niex\u003e Graphito.run(\"\"\"\n  query {\n    jedis {\n      name\n    }\n  }\n  \"\"\")\n\n%Graphito.Response{data: %{\"jedis\" =\u003e [%{\"name\" =\u003e \"luke\"}]}, status: 200, errors: nil, headers: [{\"content-type\", \"application/json\"}]}\n```\n\nA query response can be mapper to a given struct:\n\n```elixir\niex\u003e Graphito.run(\"\"\"\n  query {\n    jedis {\n      name\n      friends {\n        name\n      }\n    }\n  }\n  \"\"\", as: %Jedi{friends: %Jedi{}})\n\n%Graphito.Response{data: [%Jedi{name: \"Luke\", friends: [%Jedi{name: \"Yoda\"}]}, %Jedi{name: \"Leia\", friends: [%Jedi{name: \"Hans\"}]}]}, status: 200, errors: nil, headers: [{\"content-type\", \"application/json\"}]}\n```\n\nIf an operation fails the errors are parsed and returned:\n\n```elixir\niex\u003e Graphito.run(\"\"\"\n  query {\n    jedis {\n      lightzaber\n    }\n  }\n  \"\"\")\n\n%Graphito.Response{data: nil, status: 200, errors: [%{\"message\" =\u003e \"Cannot query field \\\"lightzaber\\\" on type \\\"Jedi\\\". Did you mean \\\"lightsaber\\\"?\"}], headers: [{\"content-type\", \"application/json\"}]}\n\niex\u003e Graphito.run(\"\"\"\n  query {\n    jedis {\n      lightsaber\n    }\n  }\n  \"\"\")\n\n%Graphito.Response{data: nil, status: 200, errors: [%{\"message\" =\u003e \"Third party server timeout\", \"code\" =\u003e 503}], headers: [{\"content-type\", \"application/json\"}]}\n```\n\nIf something fails an error is returned:\n\n```elixir\niex\u003e Graphito.run(\"\"\"\n  query {\n    jedis {\n      lightzaber\n    }\n  }\n  \"\"\")\n\n%Graphito.Response.Error{reason: :timeout, errors: [%{\"message\" =\u003e \"Failed to fetch GraphQL response\"}], headers: []}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqgadrian%2Fgraphito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqgadrian%2Fgraphito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqgadrian%2Fgraphito/lists"}