This is a Phoenix app containing examples of how to use plug_graphql which in turn uses the GraphQL Elixir Core
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.
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
- 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