From 0ac664a3dba0fefb41208c912a02c10e9fafccc9 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Thu, 18 Mar 2021 15:54:26 -0400 Subject: [PATCH] Avoid using Object.assign to attach extra properties to gql. (#380) Should fix #373. --- src/index.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2b92b67f..6cca0bef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -150,11 +150,24 @@ export function disableExperimentalFragmentVariables() { experimentalFragmentVariables = false; } -export default Object.assign(gql, { +const extras = { gql, - default: gql, resetCaches, disableFragmentWarnings, enableExperimentalFragmentVariables, disableExperimentalFragmentVariables, -}); +}; + +export namespace gql { + export const { + gql, + resetCaches, + disableFragmentWarnings, + enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables, + } = extras; +} + +gql.default = gql; + +export default gql;