From 92f748667ddbbeb4ec72dfab7808e81cc1b98f82 Mon Sep 17 00:00:00 2001 From: Laurens Kling Date: Thu, 23 Mar 2023 09:42:20 +0100 Subject: [PATCH] No need for JSON.stringify when results are already String (#408) --- .changeset/few-points-do.md | 5 +++++ packages/gatsby-source-strapi/src/fetch.js | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/few-points-do.md diff --git a/.changeset/few-points-do.md b/.changeset/few-points-do.md new file mode 100644 index 000000000..1c3f1c1fc --- /dev/null +++ b/.changeset/few-points-do.md @@ -0,0 +1,5 @@ +--- +"gatsby-source-strapi": patch +--- + +No need for JSON.stringify when results are already String diff --git a/packages/gatsby-source-strapi/src/fetch.js b/packages/gatsby-source-strapi/src/fetch.js index 5dc82e525..84b477a3a 100644 --- a/packages/gatsby-source-strapi/src/fetch.js +++ b/packages/gatsby-source-strapi/src/fetch.js @@ -37,8 +37,8 @@ export const fetchEntity = async ({ endpoint, queryParams, uid, pluginOptions }, try { reporter.info( - `Starting to fetch data from Strapi - ${options.url} with ${JSON.stringify( - options.paramsSerializer(options.params) + `Starting to fetch data from Strapi - ${options.url} with ${options.paramsSerializer( + options.params )}` ); @@ -120,8 +120,8 @@ export const fetchEntities = async ({ endpoint, queryParams, uid, pluginOptions try { reporter.info( - `Starting to fetch data from Strapi - ${options.url} with ${JSON.stringify( - options.paramsSerializer(options.params) + `Starting to fetch data from Strapi - ${options.url} with ${options.paramsSerializer( + options.params )}` ); @@ -151,9 +151,9 @@ export const fetchEntities = async ({ endpoint, queryParams, uid, pluginOptions }; reporter.info( - `Starting to fetch page ${page} from Strapi - ${fetchOptions.url} with ${JSON.stringify( - options.paramsSerializer(fetchOptions.params) - )}` + `Starting to fetch page ${page} from Strapi - ${ + fetchOptions.url + } with ${options.paramsSerializer(fetchOptions.params)}` ); try {