hbouvier / graphql-couchdb-server

A GraphQL server for a Post/Comments API implemented with CouchDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL CouchDB Post/Comment Server

Seed the CouchDB database

This command will DROP the table article and recreate it with the initial data.

./graphql --initialize

Start the GraphQL server

The server will listen to http://0.0.0.0:4000 by default and will connect to CouchDB at http://admin:admin@127.0.0.1:5984

./graphql --server

Start your web browser

open http://localhost:4000

Query GraphQL

Auteur

query auteurs {
  auteurs {
    id
    sobriquet
    prenom
    nom
    creation
    articles {
      id
      titre
      text
      creation
      commentaires {
        id
        titre
        text
        pointage
        auteur {
          id
          sobriquet
          prenom
          nom
          creation
        }
      }
    }
    commentaires {
      id
      titre
      text
      pointage
    }
  }
}

Article

query {
  articles {
    id
    titre
    text
    creation
    auteur {
      id
      sobriquet
      prenom
      nom
      creation
    }
    commentaires {
      id
      titre
      text
      pointage
      auteur {
        id
        sobriquet
        prenom
        nom
        creation
      }
    }
  }
}

Commentaire

query {
  commentaires {
    id
    titre
    text
    pointage
    auteur {
      id
      sobriquet
      prenom
      nom
      creation
    }
  }
}

About

A GraphQL server for a Post/Comments API implemented with CouchDB


Languages

Language:JavaScript 100.0%