Mirror: The small sibling of the graphql package, slimmed down for client-side libraries.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add notes from discussion thread on bundlesize impact

See: https://github.com/FormidableLabs/urql/discussions/1905

+22
+22
README.md
··· 303 303 | `GraphQLInputObjectType` | _removed_ | n/a | 304 304 305 305 </details> 306 + 307 + ### Bundlesize Impact 308 + 309 + Most GraphQL client-side libraries use the following common set of imports from the `graphql` library. 310 + Assuming a transformation like [`babel-plugin-modular-graphql`](https://github.com/kitten/babel-plugin-modular-graphql/) 311 + or granular imports in general this creates a short list of utilities. 312 + 313 + ```js 314 + export { valueFromASTUntyped } from 'graphql/utilities/valueFromASTUntyped.mjs'; 315 + export { GraphQLError } from 'graphql/error/GraphQLError.mjs'; 316 + export { Kind } from 'graphql/language/kinds.mjs'; 317 + export { parse } from 'graphql/language/parser.mjs'; 318 + export { print } from 'graphql/language/printer.mjs'; 319 + export { visit } from 'graphql/language/visitor.mjs'; 320 + ``` 321 + 322 + The minzipped size of the imports is about `11.2kB` in a given output bundle, which assumes all the above imports are 323 + in use. When the GraphQL language parser is dropped from the bundle, for instance by precompiling queries and excluding 324 + it in a compilation step, the resulting minzipped size drops to `5.55kB`. 325 + 326 + When `graphql-web-lite` replaces the `graphql` package the minzipped size drops from the `11.2kB` figure down to `5.44kB`, 327 + and `3.19kB` without the parser.