Skip to content

dogbutcat/graphql-api-encryption-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

GraphQL server and client(Apollo) api hidding example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages