From 764ec3bcad5120c40b946c66c4fa15041baa44f2 Mon Sep 17 00:00:00 2001 From: Brandon Krigbaum Date: Tue, 19 Sep 2023 12:18:49 -0500 Subject: [PATCH] Update create client to support new format --- packages/marko-web-native-x/apollo/create-client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-native-x/apollo/create-client.js b/packages/marko-web-native-x/apollo/create-client.js index 8865b6286..1c360fd1c 100644 --- a/packages/marko-web-native-x/apollo/create-client.js +++ b/packages/marko-web-native-x/apollo/create-client.js @@ -1,4 +1,5 @@ const fetch = require('node-fetch'); +const { get } = require('@parameter1/base-cms-object-path'); const getOperationName = (string) => { const matches = /query\s+([a-z0-9]+)[(]?.+{/gi.exec(string); @@ -11,7 +12,7 @@ module.exports = (uri) => Object.create({ const body = JSON.stringify({ operationName: getOperationName(query), variables, - query, + query: get(query, 'loc.source.body', query), }); const res = await fetch(uri, {