Skip to content

Commit b63649a

Browse files
DavidMNormandavidtoyoukimexlxxnJoanManto
committed
Update readme, prune router settings
Co-authored-by: David Norman <[email protected]> Co-authored-by: David Kim <[email protected]> Co-authored-by: Eileen Cho <[email protected]> Co-authored-by: Joan Manto <[email protected]>
1 parent 6925b39 commit b63649a

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,36 @@ const GraphQLRouter =
6464
ObsRouter >
6565
{
6666
Router,
67-
typeDefs: types,
68-
resolvers: resolvers,
69-
redisPort: 6379, //Desired redis port
70-
useCache: true, //Boolean to toggle all cache functionality
71-
usePlayground: true, //Boolean to allow for graphQL playground
72-
persistQueries: true, //Boolean to toggle the use of persistant queries
73-
searchTerms: [] //Optional array to allow board queries to store according to search fields so individual searches are found in cache
74-
customIdentifier: ['id', '__typename'],
75-
mutationTableMap = {}, //Object where keys are add mutation types and value is an array of affected tables (e.g. {addPlants: ['plants'], addMovie: ['movies']})
67+
typeDefs: types, // graphQL typeDefs
68+
resolvers: resolvers, // graphQL resolvers
7669
};
7770

7871
// attach the graphql routers routes to our app
7972
app.use(GraphQLRouter.routes(), GraphQLRouter.allowedMethods());
8073
```
74+
## Selecting options for the Router
75+
```javascript
76+
const GraphQLRouter =
77+
(await ObsidianRouter) <
78+
ObsRouter >
79+
{
80+
Router, // Router that is initialized by server.
81+
path = '/graphql', // endpoint for graphQL queries, default to '/graphql'
82+
typeDefs: types, // graphQL typeDefs
83+
resolvers: resolvers, // graphQL resolvers
84+
usePlayground: true, // Boolean to allow for graphQL playground, default to false
85+
useCache: true, // Boolean to toggle all cache functionality, default to true
86+
redisPort: 6379, // Desired redis port, default to 6379
87+
policy: 'allkeys-lru', // Option select your Redis policy, default to allkeys-lru
88+
maxmemory = '2000mb', // Option to select Redis capacity, default to 2000mb
89+
searchTerms: [] //Optional array to allow board queries to store according to search fields so individual searches are found in cache
90+
persistQueries: true, //Boolean to toggle the use of persistant queries, default to false
91+
hashTableSize = 16, // Size of hash table for persistent queries, default to 16
92+
maxQueryDepth = 0, // Maximum depth of query, default to 0
93+
customIdentifier: ['__typename', '_id'], // keys to be used to idedntify and normalize object
94+
mutationTableMap = {}, //Object where keys are add mutation types and value is an array of affected tables (e.g. {addPlants: ['plants'], addMovie: ['movies']})
95+
};
96+
```
8197

8298
## Creating the Wrapper
8399

@@ -93,10 +109,10 @@ const App = () => {
93109
};
94110
```
95111

96-
## Selecting useCache, LFU/LRU/WTinyLFU, capacity, and searchTerms (if any); default (if not provided) true, LFU, 2000
112+
## Selecting useCache, LFU/LRU/WTinyLFU, capacity, persistQueries, and searchTerms (if any); default (if not provided): true, LFU, 2000, false
97113

98114
```javascript
99-
<ObsidianWrapper useCache={true} algo='LRU' capacity='5000' searchTerms={[title, author, ISBN]}>
115+
<ObsidianWrapper useCache={true} algo='LRU' capacity='5000' persistQueries={true} searchTerms={['title', 'director', 'genre']}>
100116
<MovieApp />
101117
</ObsidianWrapper>
102118
```
@@ -171,12 +187,12 @@ const MovieApp = () => {
171187

172188
Information and instructions on how to use our developer tool can be found here <br/>
173189
works with Obsidian 8.0 <br/>
174-
[oslabs-beta/obsidian-developer-tool](https://github.com/oslabs/obsidian-devtool)
190+
[oslabs/obsidian-developer-tool](https://github.com/open-source-labs/obsidian-developer-tool)
175191

176192
## Obsidian 8.0 Demo
177193

178194
Github for a demo with some example code to play with: <br/>
179-
[oslabs-beta/obsidian-demo-5.0](https://github.com/oslabs-beta/obsidian-demo-5.0)
195+
[oslabs-beta/obsidian-demo-8.0](https://github.com/oslabs-beta/obsidian-demo-5.0)
180196

181197
## Dockerized Demo
182198

@@ -185,7 +201,9 @@ Working demo to install locally in docker:
185201

186202
## Features In Progress
187203

188-
-
204+
- Server-side caching improvements
205+
- More comprehensive mutation support
206+
- searchTerms option optimization
189207
- Ability to store/read only the whole query
190208
- Hill Climber optimization for W-TinyLFU cache size allocation
191209
- Developer Tool View Cache component, and Playground component

src/Obsidian.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export interface ObsidianRouterOptions<T> {
2828
usePlayground?: boolean;
2929
useCache?: boolean;
3030
redisPort?: number;
31-
redisURI?: string;
3231
policy?: string;
3332
maxmemory?: string;
3433
searchTerms?: string[];

0 commit comments

Comments
 (0)