Skip to content

Commit

Permalink
Strip ignored characters when printing a query in executor-http (#6332)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed Jul 10, 2024
1 parent bdfbcec commit 7be6930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-jars-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-tools/executor-http": patch
---

Strip ignored characters when printing a query in executor-http
4 changes: 2 additions & 2 deletions packages/executors/http/src/defaultPrintFn.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DocumentNode, print } from 'graphql';
import { DocumentNode, print, stripIgnoredCharacters } from 'graphql';

const printCache = new WeakMap<DocumentNode, string>();

export function defaultPrintFn(document: DocumentNode) {
let printed = printCache.get(document);
if (!printed) {
printed = print(document);
printed = stripIgnoredCharacters(print(document));
printCache.set(document, printed);
}
return printed;
Expand Down

0 comments on commit 7be6930

Please sign in to comment.