Skip to content

e-lam/Lancey-GraphQL-POC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lancey GraphQL POC

Concept

Implementing this architecture :

Install

First things first :

  • Elixir/Erlang
  • After installing Elixir, you need to install hex : $ mix local.hex
  • Overmind (Process manager for Procfile-based applications and tmux)
  • You need PostgreSQL

Setup apps

After cloning this repo, your need to :

1. Simple Rest API

  • Go to Rest API : cd rest
  • Install dependencies : mix deps.get

2. GraphQL API Server

  • Go to Rest API : cd api
  • Install dependencies : mix deps.get
  • Setup database and run seeds : mix ecto.setup

Go to the moon 🚀

  • At the root folder : $ overmind start
  • Open your browser on GraphiQL : http://0.0.0.0:4000/graphiql

(See REST-API http://0.0.0.0:8880/users/)

Query Examples

Query all authors (Via Rest API)

query {
  authors {
    id
    name
    age
  }
}

Query all posts (On database)

query {
  posts {
    id
    title
    description
  }
}

Create a post

mutation CreatePost {
  createPost(title: "Second", description: "We're off to a great start!") {
    id
    title
  }
}

✨✨ Start magic (MIX BOTH) ✨✨

query {
  posts {
    id
    title
    description
    author {
      name
      age
    }
  }
}

Read more on GraphQL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages