├── .DS_Store
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── LICENSE.txt
├── README.md
├── __tests__
└── package.json
├── appspec.yml
├── dist
├── 09b15ca8b7c8c9c0e312689c43705fc9.png
├── 196fe2c644b80ada4fd0a665f0206307.png
├── 1f2da45411728b5788423767bcf13981.png
├── 29bee30226fd116d1e01b7f43c79e93c.png
├── 2ab3fc407e5d2d5c1486b43b1a1aa2df.png
├── 2b2ccd24da1e291a4d7b966cd5aaae43.png
├── 619ac5ec97620f0e274878d51e4e47c6.png
├── 69ccd4eabb21b1ad8eac50dab5903a05.png
├── 6feb0ea439b5cb6ee74291fa3e2e45d2.png
├── 83fe72be1352299b2d3df5d657664954.png
├── a39f6a67fbcf0e2868f9603dfbfe500e.png
├── aad6c641a2d7c79758da48abda119985.png
├── ade232f25687acaeb8b1530bf46bd3b2.png
├── af108db04a54d784da9bf75244a6daf5.png
├── bundle.js
├── bundle.js.LICENSE.txt
├── d15af6ac3714df84fd5293a896b05972.png
├── f503499b382dcc2e9c767d0d1965cea7.png
├── fc6b9451733c620ceb86a49ca3953d65.png
└── index.html
├── npm-package
├── Helpers
│ └── cleanQuery.js
├── lightql.ts
├── package-lock.json
└── package.json
├── package-lock.json
├── package.json
├── scripts
├── install_dependencies
└── start_server
├── src
├── .DS_Store
├── assets
│ ├── LightQL.png
│ ├── black-logo.png
│ ├── cassidy.png
│ ├── cyrus.png
│ ├── docs-example.png
│ ├── drew.png
│ ├── graphql-logo.png
│ ├── jest-js-icon.png
│ ├── local-forage.png
│ ├── lower-left-lines.png
│ ├── nobg-LightQL.png
│ ├── npm-vector.png
│ ├── pierce.png
│ ├── rhea.png
│ ├── typescript-logo.png
│ └── upper-right-lines.png
├── client
│ ├── exports.d.ts
│ ├── index.html
│ ├── index.tsx
│ └── webpage
│ │ ├── components
│ │ ├── AboutUs.tsx
│ │ ├── App.tsx
│ │ ├── Docs.tsx
│ │ ├── Homepage.tsx
│ │ ├── aboutUsComponents
│ │ │ └── SingleTile.tsx
│ │ └── homepageComponents
│ │ │ ├── Demo.js
│ │ │ ├── Descriptions.tsx
│ │ │ ├── Hero.tsx
│ │ │ ├── OneBox.tsx
│ │ │ └── ThreeBox.tsx
│ │ └── styling
│ │ ├── aboutUs.scss
│ │ ├── boxes.scss
│ │ ├── demo.scss
│ │ ├── descriptions.scss
│ │ ├── docs.scss
│ │ ├── hero.scss
│ │ └── sitewide.scss
└── simulation
│ ├── graphQLSchemas.ts
│ ├── models.ts
│ ├── server.ts
│ ├── simpleTable.sql
│ └── user_data.sql
├── tsconfig.json
├── tslint.json
└── webpack.config.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oslabs-beta/LightQL/83dff8889140f841a9bfdae409f25b2db56e76d5/.DS_Store
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | src/models
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "parserOptions": {
4 | "sourceType": "module"
5 | }
6 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | .env
3 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | MIT License
4 |
5 | Copyright (c) 2022 LightQL
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 | Welcome to LightQL. A lightspeed, lightweight client-side cache for GraphQL.
14 |
15 | Explore the docs »
16 |
17 |
18 | View Demo
19 |
36 | LightQL is an open-source developer tool that leverages the 37 | pinpoint accuracy of GraphQL's queries and implements caching to 38 | improve your website's query efficiency. 39 |
40 |57 | If this is your first time using LightQL, run the following 58 | command in your terminal: 59 |
60 |npm install lightql-cache62 | 72 |
75 | In your frontend app’s file (e.g. your ***filename.js*** file), 76 | you want to import our LightQL module to handle GraphQL requests 77 | using the ES6 module format. This can also be done in your React 78 | (.jsx), Typescript (.ts and .tsx), and similar file formats. 79 |
80 | 81 |{importStr}83 | 93 |
96 | Next, create an instance of a cache using the de-structured 97 | LRUCache object, passing in a capacity as the first argument. 98 | The capacity must be an integer and greater than zero. You must 99 | also pass in a valid GraphQL endpoint as a string as the second 100 | argument. We have set a capacity of 3 in our example below: 101 |
102 | 103 |105 | const cache = new LRUCache(3, 106 | 'http://localhost:3000/graphql'); 107 |108 | 118 |
121 | Now, to make your first query to the cache, you create a GraphQL 122 | formatted query string based on your requirements, for example: 123 |
124 |126 | {graphqlQueryStr} 127 |128 |
131 | Next, we invoke the get function associated with the named 132 | variable you have for the LRUCache, and pass in your query 133 | string and associate variables if necessary. The get function 134 | always returns a promise, therefore it is best to generate an 135 | async function that leverages the await syntax to resolve the 136 | data returned from the cache. 137 |
138 | 139 |{callTheCache}141 | 153 |
156 | Now, you are properly set up and can use the data as you wish! 157 |
158 | 159 |160 | A quick example: imagine you had a React app that included 161 | Chart.js functionality that you wanted to display on a specific 162 | page. You could import LightQL cache to effectively retrieve 163 | your data from your database, and then store it in your 164 | client-side LightQL caching solution. Then, every time you 165 | wanted to display the correct chart.js data, you could grab the 166 | correct information from your LightQL cache with extremely low 167 | latency time. Example code below: 168 |
169 | 170 |{queryStr}101 |
105 | {pulledData}
106 |
107 | {uncachedTime}
124 |{currentTime}
125 |18 | Bloated NPM installs with 100+ dependencies and packages, pulling in 19 | 35MB+ of JS generates a bundle size that could lead to poor app 20 | performance in bandwith constrained apps. There is also a lack of 21 | support for other frameworks outside of React. 22 |
23 |29 | You want extremely low latency, client-side caching with persistent 30 | data storage. You want a high cache hit-rate from a lazy loading 31 | implementation to improve performance and save system resources. You 32 | want to set up ALL OF THIS in seconds. 33 |
34 |42 | In order to provide the developer with very efficient caching for 43 | their GraphQL queries, LightQL implements a modern tech stack. Cache 44 | your queries with us to leverage these technologies and improve your 45 | application performance! 46 |
47 |55 | Typescript 56 |
57 |65 | GraphQL 66 |
67 |71 | Jest 72 |
73 |81 | Local Forage 82 |
83 |38 | A lightspeed, lightweight client-side cache for GraphQL. 39 |
40 |43 | $ 44 |
45 |46 | npm install lightql-cache 47 |
48 | 51 | navigator.clipboard.writeText('npm install lightql-cache') 52 | } 53 | style={{ color: '#323949' }} 54 | > 55 | 56 | 57 |Contact us
66 | 67 |{text}
17 |