Created
August 10, 2017 17:40
-
-
Save aofleejay/26ff177a77db3ac88bb6a47a214ffb12 to your computer and use it in GitHub Desktop.
Apollo-client afterware
This file contains hidden or 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
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