Company
Date Published
Author
Leo Pradel
Word count
1392
Language
English
Hacker News points
None

Summary

This tutorial explains how to implement email and password authentication with `accounts-js` and Apollo Server. The author creates a new Node.js project, sets up the dependencies, including `apollo-server`, `graphql`, and `mongoose`. They then configure `accounts-js` to use MongoDB as its database and create an authentication server using `AccountsServer`. The tutorial demonstrates how to merge the `accounts-js` GraphQL schema with the existing schema, creating a new GraphQL API. The author creates a user, authenticates them, and protects a query using the `@auth` directive. They provide a link to a repository containing the source code for this tutorial.