Awesome
GraphQL Phoenix Examples
This is a Phoenix app containing examples of how to use plug_graphql which in turn uses the GraphQL Elixir Core
Installation
Clone this repo and start your Phoenix app:
- Install dependencies with
mix deps.get
- Create your development database using
mix ecto.create
. NOTE: you may need to editconfig/dev.exs
to set up your database configuration if it is not configured for passwordless logins on localhost. - Setup your DB for the Ecto example with
mix ecto.migrate
andmix run priv/repo/seeds.exs
- Start Phoenix endpoint with
mix phoenix.server
Now you can visit localhost:4000
from your browser.
Examples
Using plug_graphql with Phoenix is very simple.
Simply mount your GraphQL endpoint like so:
- Define your schema in
web/graphql
(see https://github.com/graphql-elixir/hello_graphql_phoenix/tree/master/web/graphql) - Mount your endpoint
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