Skip to content

Can we please tree shake away graphql from final bundle? #1905

Answered by kitten
frederikhors asked this question in Q&A
Discussion options

You must be logged in to vote

It's simply not possible, no, and we've talked about this before in several issues; This basically comes down to leftover dependencies, in other words, we have several files that cannot be removed entirely, namely:

  • The parser (graphql/language/parser) cannot be removed. As @urql/core supports both raw strings and precompiled query documents, it must always have the parser available.
  • The stringifier (graphql/language/printer) cannot be removed, since it must be used (no matter whether we have raw strings or precompiled queries) to stringify the query document that is sent to the API. This cannot be skipped as we must parse the query, since it's a guarantee to have it available in unstring…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@kitten
Comment options

@frederikhors
Comment options

@frederikhors
Comment options

@frederikhors
Comment options

@frederikhors
Comment options

Answer selected by frederikhors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants