This example demonstrate how to use accounts-js.
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.
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
mutation Register {
register(user: { username: "user", password: "1234567" })
}
mutation Auth {
authenticate(
serviceName: "password"
params: { password: "1234567", user: { username: "user" } }
) {
tokens {
accessToken
}
}
}
query Test {
privateField
}