Skip to content

Commit

Permalink
Merge pull request #65 from wp-graphql/feat/simplify-mini-graphiql-re…
Browse files Browse the repository at this point in the history
…sponse

feat: simplify the MiniGraphiQL response to only include the data
  • Loading branch information
jasonbahl authored Feb 1, 2024
2 parents cba826c + c80c62e commit e38e79f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion components/MiniGraphiQL.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,23 @@ const MiniGraphiQLClient = ({ initialQuery, initialVariables, endpoint, readOnly
headers: options?.headers,
});

return res;
// Clone the response to modify it
const clonedResponse = res.clone();

// Read and modify the response
const responseData = await clonedResponse.json();
if (responseData.extensions) {
delete responseData.extensions;
}

// Create a new response with the modified data
const newResponse = new Response(JSON.stringify(responseData), {
status: res.status,
statusText: res.statusText,
headers: res.headers,
});

return newResponse;
}
});

Expand Down

2 comments on commit e38e79f

@headless-platform-by-wp-engine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the recent updates to your Atlas environment:

App Environment URL Build
acf.wpgraphql.com main https://hb…wered.com ✅ (logs)

Learn more about building on Atlas in our documentation.

@headless-platform-by-wp-engine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the recent updates to your Atlas environment:

App Environment URL Build
acf.wpgraphql.com main https://hb…wered.com ✅ (logs)

Learn more about building on Atlas in our documentation.

Please sign in to comment.