leoasis / graphql-persisted-document-loader Goto Github PK
View Code? Open in Web Editor NEWWebpack loader that adds a documentId to a compiled graphql document, which can be used when persisting/retrieving documents
License: MIT License
Webpack loader that adds a documentId to a compiled graphql document, which can be used when persisting/retrieving documents
License: MIT License
Hi! this lib is so cool, thank you ๐
This lib supports one operation by file, but the graphql-tag/loader
supports multiple.
Why do we have this limitation here?
I guess it could be useful to warn users about this limitation, since I got caught by surprise.
thanks!
I'm using create-react-app
with react-apollo
.
I'm already using https://github.com/timarney/react-app-rewired with many plugins, for example this: https://github.com/gajus/babel-plugin-graphql-tag.
I was wondering how to use your package with create-react-app
.
I'm also wondering if there is a way to use this package from babel-plugin-graphql-tag (I already opened an issue there: gajus/babel-plugin-graphql-tag#22).
Can I ask you how much do you think is the cost of hashing operation on client side (without using this package)?
This issue is fixed: webpack/webpack#4959
This webpack loader depends on persistgraphql which is deprecated and has seen no update since 2018. As this also results in transitive dependencies with security vulnerabilities (e.g. yargs-parser) we should search for an alternative approach.
I am not quite sure why persistgraphql is used, as we only need to hash the output of graphql-tag/loader. To generate the hash from the query AST we could use the print method from graphql.
For any queries or mutations that include imported fragments (as supported by graphql-tag/loader), the hash will not match the one generated by Apollo Server, resulting in a sha mismatch error.
I need to get the latest bugfix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.