Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graphql-elixir/hello_graphql_phoenix
Examples of GraphQL Elixir Plug endpoints mounted in Phoenix
https://github.com/graphql-elixir/hello_graphql_phoenix
Last synced: about 1 month ago
JSON representation
Examples of GraphQL Elixir Plug endpoints mounted in Phoenix
- Host: GitHub
- URL: https://github.com/graphql-elixir/hello_graphql_phoenix
- Owner: graphql-elixir
- License: other
- Created: 2015-12-05T05:43:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-18T17:14:51.000Z (about 8 years ago)
- Last Synced: 2024-08-01T22:51:36.420Z (4 months ago)
- Language: Elixir
- Homepage: http://playground.graphql-elixir.org
- Size: 205 KB
- Stars: 99
- Watchers: 8
- Forks: 11
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - hello_graphql_phoenix - Examples of GraphQL Elixir Plug endpoints mounted in Phoenix - [View demo online](http://playground.graphql-elixir.org). (Examples / Elixir Examples)
README
# GraphQL Phoenix Examples
[![Build Status](https://travis-ci.org/graphql-elixir/hello_graphql_phoenix.svg)](https://travis-ci.org/graphql-elixir/hello_graphql_phoenix)
[![Public Slack Discussion](https://graphql-slack.herokuapp.com/badge.svg)](https://graphql-slack.herokuapp.com/)This is a Phoenix app containing examples of how to use [plug_graphql](https://github.com/graphql-elixir/plug_graphql) which in turn uses the [GraphQL Elixir Core](https://github.com/graphql-elixir/graphql)
## Installation
Clone this repo and start your Phoenix app:
1. Install dependencies with `mix deps.get`
2. Create your development database using `mix ecto.create`.
NOTE: you may need to edit `config/dev.exs` to set up your database configuration
if it is not configured for passwordless logins on localhost.
3. Setup your DB for the Ecto example with `mix ecto.migrate` and `mix run priv/repo/seeds.exs`
4. Start Phoenix endpoint with `mix phoenix.server`Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Examples
Using [plug_graphql](https://github.com/graphql-elixir/plug_graphql) with Phoenix is very simple.
Simply mount your GraphQL endpoint like so:
1. Define your schema in `web/graphql` (see https://github.com/graphql-elixir/hello_graphql_phoenix/tree/master/web/graphql)
2. [Mount your endpoint](https://github.com/graphql-elixir/hello_graphql_phoenix/blob/master/web/router.ex#L22-L26)## Resources
* GraphQL Plug https://github.com/graphql-elixir/plug_graphql
* GraphQL Elixir Core https://github.com/graphql-elixir/graphql
* GraphQL Spec http://facebook.github.io/graphql