graphql-apq
graphql-apq copied to clipboard
Throw if invalid cache object is provided
Do you believe it is worth to do this?
I think it might be easier for the user of this library to understand what is going wrong (if you provide a good error message 😸) instead of getting a error like this.cache.keys is not a function
.
It also would be a fail fast approach which looks better to me.
BTW this looks awesome! Congratz 🎉
I think there is value in validating if the provided cache object implements the necessary interface. I won't put much efforts on this project for a while, though, because I've being talking to the Apollo Server guys and an integrated solution will be out really soon, as part of the apollo-server project itself.
Perhaps this project will continue active with the intend to provide APQ to servers other than apollo-server, though.