Skip to content

Instantly share code, notes, and snippets.

@aofleejay
Created August 10, 2017 17:40
Show Gist options
  • Save aofleejay/26ff177a77db3ac88bb6a47a214ffb12 to your computer and use it in GitHub Desktop.
Save aofleejay/26ff177a77db3ac88bb6a47a214ffb12 to your computer and use it in GitHub Desktop.
Apollo-client afterware
const logRequest = {
applyAfterware({ response }, next) {
if (response.status === 200) {
console.log('log from afterware.')
}
next()
}
}
const networkInterface = createNetworkInterface({
uri: 'https://api.graph.cool/simple/v1',
}).useAfter([ logRequest ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment