Skip to content

Commit

Permalink
No need for JSON.stringify when results are already String (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenskling authored Mar 23, 2023
1 parent b0a58af commit 92f7486
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-points-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gatsby-source-strapi": patch
---

No need for JSON.stringify when results are already String
14 changes: 7 additions & 7 deletions packages/gatsby-source-strapi/src/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)}`
);

Expand Down Expand Up @@ -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
)}`
);

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 92f7486

Please sign in to comment.