graphql-fetch
Thin, symmetrically encrypted, GraphQL client powered by fetch.
(Based on the great work of tjmehta and compatible with graphql-fetch)
Installation
npm i --save egraphql-fetch
Usage
var fetch = 'http://domain.com/graphql' 'keyId' // ... ID for the key (could be user-name) 'secretKey' // ... Secret Key to encrypt the data (could be password) // cipherAlgorithm, ... Cipher algorithm used to encrypt the request (default: aes256) // cipherPad ... Padding to make traffic guessing harder (defaults: 1024) var query = ` query q (id: String!) { user(id: $id) { id, email, name } }`var queryVars = id: 'abcdef'var opts = // custom fetch options /** * @param * @param * @param */
Notes
- Uses isomorphic-fetch under the hood, which makes
fetch
,Headers
,Request
, andResponse
globally available.
License
MIT