{"id":13499524,"url":"https://github.com/graphql-elixir/graphql","last_synced_at":"2025-10-04T16:30:48.465Z","repository":{"id":57503269,"uuid":"41307741","full_name":"graphql-elixir/graphql","owner":"graphql-elixir","description":"GraphQL Elixir","archived":true,"fork":false,"pushed_at":"2023-08-13T20:45:56.000Z","size":640,"stargazers_count":857,"open_issues_count":13,"forks_count":45,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-12-16T22:28:28.882Z","etag":null,"topics":["elixir","erlang","graphql"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphql-elixir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-08-24T14:27:16.000Z","updated_at":"2024-12-10T09:59:39.000Z","dependencies_parsed_at":"2024-01-03T06:14:54.076Z","dependency_job_id":"b3cab526-e78e-4e71-8ccb-e24534c8430a","html_url":"https://github.com/graphql-elixir/graphql","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-elixir%2Fgraphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-elixir%2Fgraphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-elixir%2Fgraphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-elixir%2Fgraphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-elixir","download_url":"https://codeload.github.com/graphql-elixir/graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235274283,"owners_count":18963888,"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":["elixir","erlang","graphql"],"created_at":"2024-07-31T22:00:34.114Z","updated_at":"2025-10-04T16:30:48.095Z","avatar_url":"https://github.com/graphql-elixir.png","language":"Elixir","readme":"# GraphQL Elixir\n\n[![Build Status](https://travis-ci.org/graphql-elixir/graphql.svg)](https://travis-ci.org/graphql-elixir/graphql)\n[![Public Slack Discussion](https://graphql-slack.herokuapp.com/badge.svg)](https://graphql-slack.herokuapp.com/)\n\nAn Elixir implementation of Facebook's GraphQL.\n\nThis is the core GraphQL query parsing and execution engine whose goal is to be\ntransport, server and datastore agnostic.\n\nIn order to setup an HTTP server (ie Phoenix) to handle GraphQL queries you will\nneed [plug_graphql](https://github.com/graphql-elixir/plug_graphql).\nExamples for Phoenix can be found at [hello_graphql_phoenix](https://github.com/graphql-elixir/hello_graphql_phoenix), so look here for a starting point for writing your own schemas.\n\nOther ways of handling queries will be added in due course.\n\n## Installation\n\nFirst, add GraphQL to your `mix.exs` dependencies:\n\n```elixir\ndefp deps do\n  [{:graphql, \"~\u003e 0.3\"}]\nend\n```\n\nAdd GraphQL to your `mix.exs` applications:\n\n```elixir\ndef application do\n  # Add the application to your list of applications.\n  # This will ensure that it will be included in a release.\n  [applications: [:logger, :graphql]]\nend\n```\n\nThen, update your dependencies:\n\n```sh-session\n$ mix deps.get\n```\n\n## Usage\n\nFirst setup your schema\n\n```elixir\ndefmodule TestSchema do\n  def schema do\n    %GraphQL.Schema{\n      query: %GraphQL.Type.ObjectType{\n        name: \"RootQueryType\",\n        fields: %{\n          greeting: %{\n            type: %GraphQL.Type.String{},\n            resolve: \u0026TestSchema.greeting/3,\n            description: \"Greeting\",\n            args: %{\n              name: %{type: %GraphQL.Type.String{}, description: \"The name of who you'd like to greet.\"},\n            }\n          }\n        }\n      }\n    }\n  end\n\n  def greeting(_, %{name: name}, _), do: \"Hello, #{name}!\"\n  def greeting(_, _, _), do: \"Hello, world!\"\nend\n```\n\nExecute a simple GraphQL query\n\n```elixir\niex\u003e GraphQL.execute(TestSchema.schema, \"{greeting}\")\n{:ok, %{data: %{\"greeting\" =\u003e \"Hello, world!\"}}}\n```\n\n## Status\n\nThis is a work in progress, right now here's what is done:\n\n- [x] Parser for GraphQL (including Type definitions)\n- [x] AST matching the `graphql-js` types as closely as possible\n- [x] Schema definition\n- [x] Query execution\n  - [x] Scalar types\n  - [x] Arguments\n  - [x] Multiple forms of resolution\n  - [x] Complex types (List, Object, etc)\n  - [x] Fragments in queries\n  - [x] Extract variable values\n- [x] Introspection\n- [WIP] Query validation\n- [ ] Directives\n\n## Resources\n\n- [GraphQL Spec](http://facebook.github.io/graphql/) This incredibly well written spec made writing the GraphQL parser pretty straightforward.\n- [GraphQL JS Reference Implementation](https://github.com/graphql/graphql-js)\n\n## Implementation\n\nTokenisation is done with [leex](http://erlang.org/doc/man/leex.html) and parsing with [yecc](http://erlang.org/doc/man/yecc.html). Both very useful Erlang tools for parsing. Yecc in particular is used by Elixir itself.\n\nSome resources on using leex and yecc:\n\n* http://relops.com/blog/2014/01/13/leex_and_yecc/\n* http://andrealeopardi.com/posts/tokenizing-and-parsing-in-elixir-using-leex-and-yecc/\n\nThe Execution logic follows the [GraphQL JS Reference Implementation](https://github.com/graphql/graphql-js) pretty closely, as does the module structure of the project. Not to mention the naming of files and concepts.\n\nIf you spot anything that isn't following Elixir conventions though, that's a mistake. Please let us know by opening an issue or a PR and we'll fix it.\n\n## Developers\n\n### Getting Started\n\nClone the repo and fetch its dependencies:\n\n```\n$ git clone https://github.com/graphql-elixir/graphql.git\n$ cd graphql\n$ mix deps.get\n$ mix test\n```\n\n### Atom Editor Support\n\n\u003e  Using the `language-erlang` package? `.xrl` and `.yrl` files not syntax highlighting?\n\nSyntax highlighting in Atom for `leex` (`.xrl`) and `yecc` (`yrl`) can be added by modifying `grammars/erlang.cson`.\n\nJust open the `atom-language-erlang` package code in Atom and make the change described here:\n\nhttps://github.com/jonathanmarvens/atom-language-erlang/pull/11\n\nhowever if that PR has been merged then just grab the latest version of the plugin!\n\n## Contributing\n\nWe actively welcome pull requests, bug reports, feedback, issues, questions. Come and chat in the [#erlang channel on Slack](https://graphql-slack.herokuapp.com/)\n\nIf you're planning to implement anything major, please let us know before you get too far so we can make sure your PR will be as mergable as possible. Oh, and don't forget to write tests.\n\n## License\n\n[BSD](https://github.com/graphql-elixir/graphql/blob/master/LICENSE).\n","funding_links":[],"categories":["Libraries","Elixir","Domain-specific language","Implementations"],"sub_categories":["Elixir Libraries","Elixir"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-elixir%2Fgraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-elixir%2Fgraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-elixir%2Fgraphql/lists"}