https://github.com/jkettmann/frontend-for-authentication-with-graphql-and-passport
https://github.com/jkettmann/frontend-for-authentication-with-graphql-and-passport
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jkettmann/frontend-for-authentication-with-graphql-and-passport
- Owner: jkettmann
- Created: 2019-08-02T05:53:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-15T10:40:20.000Z (over 5 years ago)
- Last Synced: 2025-04-23T20:05:14.369Z (5 days ago)
- Language: JavaScript
- Size: 367 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project was set up using `create-react-app`. All client side code resides in the `/src` folder. You can find the code for the GraphQL API inside the `/api` directory.
## Articles of this series
[Preparing a GraphQL server for authentication](https://jkettmann.com/authentication-and-authorization-with-graphql-and-passport/)
[Password-based authentication with GraphQL and Passport](https://jkettmann.com/password-based-authentication-with-graphql-and-passport/)
[Facebook login with GraphQL and Passport](https://jkettmann.com/facebook-login-with-graphql-and-passport/)
[Building the React frontend](https://jkettmann.com/authentication-with-graphql-and-passport-js-the-frontend/)
[3 ways for authorization with GraphQL and Apollo](https://jkettmann.com/3-ways-for-authorization-with-graphql-and-apollo/)
[Authorization with GraphQL and custom directives](https://jkettmann.com/authorization-with-graphql-and-custom-directives/)
## How to install and run the project
To install and start the app run following commands.
```
npm install
npm start
```Visit [http://localhost:4000/graphql](http://localhost:4000/graphql). You will see the Apollo playground. There you can run following query and mutation
```graphql
mutation {
login(email: "[email protected]", password: "abcdefg") {
user {
id
firstName
lastName
}
}
}mutation {
signup(
firstName: "Jen",
lastName: "Barber",
email: "[email protected]",
password: "qwerty"
) {
user {
id
firstName
lastName
}
}
}query {
currentUser {
id
firstName
lastName
}
}mutation {
logout
}
```