From 288194218840e627ada541c817cf56c8a7826cd3 Mon Sep 17 00:00:00 2001 From: Fju Date: Sat, 10 Oct 2020 16:43:40 +0200 Subject: [PATCH] Add defaultOptions object to ClientConfig for createApolloClient() --- lib/templates/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/templates/plugin.js b/lib/templates/plugin.js index db4e7792..9e67fe5e 100644 --- a/lib/templates/plugin.js +++ b/lib/templates/plugin.js @@ -65,6 +65,10 @@ export default (ctx, inject) => { <%= key %>ClientConfig.httpEndpoint = <%= key %>ClientConfig.browserHttpEndpoint } + <% if (options.defaultOptions) { %> + <%= key %>ClientConfig.apollo = { defaultOptions: <%= JSON.stringify(options.defaultOptions) %> } + <% } %> + <%= key %>ClientConfig.ssr = !!process.server <%= key %>ClientConfig.cache = <%= key %>Cache <%= key %>ClientConfig.tokenName = <%= key %>TokenName