File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ createApolloClient({
26
26
// Custom starting link.
27
27
// If you want to replace the default HttpLink, set `defaultHttpLink` to false
28
28
link: null ,
29
+ // Custom pre-auth links
30
+ // Useful if you want, for example, to set a custom middleware for refreshing an access token.
31
+ preAuthLinks: [],
29
32
// If true, add the default HttpLink.
30
33
// Disable it if you want to replace it with a terminating link using `link` option.
31
34
defaultHttpLink: true ,
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ export function createApolloClient ({
29
29
// Custom starting link.
30
30
// If you want to replace the default HttpLink, set `defaultHttpLink` to false
31
31
link = null ,
32
+ // Custom pre-auth links
33
+ // Useful if you want, for example, to set a custom middleware for refreshing an access token.
34
+ preAuthLinks = [ ] ,
32
35
// If true, add the default HttpLink.
33
36
// Disable it if you want to replace it with a terminating link using `link` option.
34
37
defaultHttpLink = true ,
@@ -85,6 +88,10 @@ export function createApolloClient ({
85
88
86
89
// Concat all the http link parts
87
90
link = authLink . concat ( link )
91
+
92
+ if ( preAuthLinks . length ) {
93
+ link = from ( preAuthLinks ) . concat ( authLink )
94
+ }
88
95
}
89
96
90
97
// On the server, we don't want WebSockets and Upload links
You can’t perform that action at this time.
0 commit comments