Skip to content

Schibsted-Tech-Polska/nodejs-tech-talks-graphql

Repository files navigation

Node.js Tech Talks - How to use GraphQL for an app bigger than a to-do list

This is demo app that shows how to use GraphQL with:

How to use it

First install required dependencies locally using npm ci. Then use Docker to start everything up: docker-compose up. It will setup Postgres database with initial schema and data, server app and client app.

GraphQL Server that retrieves data from Postgres Database

You can use GraphqQL Playground http://localhost:3000/graphql to query sample data

{
  categories {
    id
    name
    products {
      id
      name
      description
    }
  }
}

Server app logs basic info of every request (method, url, body) and requests made to database.

Simple client built with Webpack that uses Apollo Client to fetch data from server and displays data in json format

Used packages

Server app

  • koa
  • apollo-server-koa
  • graphql
  • knex

Client app

  • graphql
  • apollo-client
  • apollo-cache-inmemory
  • apollo-link-http
  • graphql-tag
  • webpack