Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix security vulnerabilities #18

Closed
ChristophWalter opened this issue May 5, 2020 · 4 comments
Closed

Fix security vulnerabilities #18

ChristophWalter opened this issue May 5, 2020 · 4 comments

Comments

@ChristophWalter
Copy link

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.

@cipater
Copy link

cipater commented Aug 12, 2020

For what it's worth, I have fork at https://github.com/cipater/graphql-persisted-document-loader that ditches persistgraphql and uses graphql and apollo-graphql instead to generate a documentID that is consistent with the hash generated by apollo client:extract.

I believe it also fixes #5

@kbariotis
Copy link
Contributor

Thanks for that @cipater. I have a question, what exactly does that piece from persistgraphql? Why is needed?

thanks

@cipater
Copy link

cipater commented Nov 16, 2020

@kbariotis It adds the __typename field to your queries:

https://github.com/leoasis/graphql-persisted-document-loader/blob/master/README.md

@leoasis
Copy link
Owner

leoasis commented Dec 8, 2020

Fixed by #23

@leoasis leoasis closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants