RFC: Reduce whitespace in queries by using stripIgnoredCharacters
#907
Labels
future 🔮
An enhancement or feature proposal that will be addressed after the next release
Summary
Currently when we make graphql requests using GET, the length of the request is much longer than anticipated because whitespace is included in the request itself. From my research, this appears to occur when we transform the AST from
graphql-tag
into a string viagraphql
. Aside from being a longer (and therefore slower) request, this also hits max length issues which are most apparent on GET requests.Proposed Solution
graphql
14.3.0
adds a utility function calledstripIgnoredCharacters
( graphql/graphql-js#1802 ) that we can call on the stringified request to remove whitespace characters that don't impact the query itself. We should make use of this utility function.I'll attach a sample request and the formatted query as a follow up
The text was updated successfully, but these errors were encountered: