Skip to content

Commit

Permalink
Merge pull request birkir#123 from bwlt/bwlt/optimize-query-size
Browse files Browse the repository at this point in the history
feat: optimize query size
  • Loading branch information
birkir committed Feb 4, 2020
2 parents 474efaa + 8fcec72 commit 46f0e6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/gatsby-source-prismic-graphql/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export function fetchStripQueryWhitespace(url: string, ...args: any) {
String(queryString.get('query'))
.replace(/\#.*\n/g, '')
.replace(/\s+/g, ' ')
.replace(/\s?\{\s?/g, '{')
.replace(/\s?\}\s?/g, '}')
.replace(/\s?\:\s?/g, ':')
.replace(/\s?\(\s?/g, '(')
.replace(/\s?\)\s?/g, ')')
.replace(/\.\.\.\s/g, '...')
.replace(/\,\s/g, ',')
);
}
const updatedQs = Array.from(queryString)
Expand Down

0 comments on commit 46f0e6a

Please sign in to comment.