Advertisement
aleffelixf

AuthenticatedDataSource.js

Mar 18th, 2020
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import FileUploadDataSource from '@profusion/apollo-federation-upload'
  2.  
  3. export default class AuthenticatedDataSource extends FileUploadDataSource {
  4. willSendRequest({request, context}): void {
  5. if (request.http) {
  6. request.http.headers.set('authorization', context.token)
  7. }
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement