0.0.4 • Published 1 year ago

dashql v0.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

graphql redis typescript

About

dashQL is a lightweight GraphQL caching tool utilizing Redis to cache queries at the field level to further improve reponse time and decrease the number of redundant requests required

Features

  • Allows for caching at the field level from the GraphQL abstract syntax tree
  • Ability to handle query requests both with and without an argument
  • Ability to cache deeply nested queries

Getting Started

  1. Install redis and define host and port in server file
const redisClient = redis.createClient({
host: "localhost",
port: 6379,
});
  1. Download dashQL as an npm module and save it to your package.json as a dependency
npm install dashql
  1. Import dashQL into server file
const dashClass = require('dashQL');
  1. Add URL (or port number if using localhost) to and ENV file
URL=example.com

// Optional port number
PORT=8080
  1. Create an instance of dashQL by passing in redisClient in server file
const dashQL = new dashClass(redisClient);
  1. On your server file which handles graphQL requests, name the endpoint '/dashQL' and put in dashQL as your middleware and return res.locals back to client
app.use('/dashQL', dashQL, (req: Request, res: Response) => {
  return res.status(200).send(res.locals.dashQL);
});
  1. Enjoy significantly faster response times specifically at the field level not just per query string!

Authors

Dan Bonney LinkedIn | Github
Meredith Fronheiser LinkedIn | Github
Kevin Klochan LinkedIn | Github
Drew Williams LinkedIn | Github

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago