Skip to content
This repository has been archived by the owner on Oct 7, 2018. It is now read-only.

Latest commit

 

History

History

graphql-server-typescript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

graphql-server-typescript

This example demonstrate how to use accounts-js.

Prerequisites

You will need a MongoDB server to run this server. If you don't have a MongoDB server running already, and you have Docker & Docker Compose, you can do

docker-compose up -d

to start a new one.

Getting Started

git clone https://github.com/accounts-js/examples.git
cd examples/graphql-server-typescript
yarn install

Start the app.

Visit http://localhost:4000/

yarn start

-> Start the client side.

mutation Register {
  register(user: { username: "user", password: "1234567" })
}

mutation Auth {
  authenticate(
    serviceName: "password"
    params: { password: "1234567", user: { username: "user" } }
  ) {
    tokens {
      accessToken
    }
  }
}

query Test {
  privateField
}