Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.06 KB

README.md

File metadata and controls

40 lines (26 loc) · 1.06 KB

GraphQL API Encryption Example

Remember run npm install in project root and client folder

Memo

this project is for quick start a apollo(GraphQL) react frontend and GraphQL nodejs backend based on this tutorial video, many thanks to Traversy Media.

Schema

.
├── LICENSE
├── README.md
├── client // all frontend code
├── config // nodejs server config
├── middleware // encryption middleware
├── package-lock.json
├── package.json
├── schema.js // graphql schema file
└── server.js // express server entry

What's new here

Simply add post data encryption between request and server middleware, replace default fetcher with axios in apollo-client.

Add decryption middleware before express-graphql for decrypting data to main graphql server.

How encryption works

encryption method includes RSA 1024 and AES 128 mode ECB pkcs7 padding

client side

client

server side

server