Created
April 8, 2020 19:15
-
-
Save lorensr/9c09da895fa0096ed58c2e883b16ff88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DataSource } from 'apollo-datasource' | |
import { InMemoryLRUCache } from 'apollo-server-caching' | |
import DataLoader from 'dataloader' | |
class FooDataSource extends DataSource { | |
constructor(dbClient) { ... } | |
initialize({ context, cache } = {}) { ... } | |
didEncounterError(error) { ... } | |
cacheKey(id) { ... } | |
async get(id, { ttlInSeconds } = {}) { ... } | |
async update(id, newDoc) { ... } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment