Last active
April 9, 2020 08:07
-
-
Save SurbhiKatariya/6581b01ab0eaf136cd6fedaf26db289d to your computer and use it in GitHub Desktop.
Create custom link
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
const httpLink = new HttpLink({ | |
uri: 'https://api.graph.cool/simple/v1/ciyz901en4j590185wkmexyex' | |
}) | |
// set authorization header to authenticate the request using apollo link, it is optional. | |
/* | |
const authMiddleware = new ApolloLink((operation, forward) => { | |
const token = 'cllHNFlaZkpXbg64Qzh0Z3VJT2FOdz09' | |
operation.setContext({ | |
headers: { | |
authorization: `Bearer ${token}` | |
} | |
}) | |
return forward(operation) | |
}) | |
*/ | |
const link = ApolloLink.from([ | |
// authMiddleware, | |
httpLink | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment