graphql-persisted-document-loader icon indicating copy to clipboard operation
graphql-persisted-document-loader copied to clipboard

Allow for custom queryTransformers

Open toddtarsi opened this issue 7 years ago • 8 comments

First off, let me start by saying nice plugin!

Next, I would like to request this feature. This would allow me to chain my custom persistgraphql queryTransformers via your tool, and still use the very simple assignment method of generateId: query => persistedQueries[query]. I am a fan of Apollo 2.0, but I don't feel ready to go all in on engine yet, so I don't use apollo-link-persisted-queries in the ad hoc method prescribed in the demos. As a result of using link directives, my queries have to be adjusted for the server. For example, I chain the addTypename queryTransformer with another transform to strip client fields. Rather than process the query in generateId and try to connect the dots, I'd rather transform the persistedQueries here as well and keep the same generateId call as before.

Please let me know your thoughts, and thanks!

toddtarsi avatar May 04 '18 03:05 toddtarsi

Hello, I just wanted to see if there were any issues here that I needed to address. I only need to use an optional override here, and can add to the documentation or whatever. Thanks for the repo!

toddtarsi avatar May 18 '18 16:05 toddtarsi

Bump. This is a little silly. If you don't respond by the end of the month, I'll assume this is a dead repo, and make a competitor on npm and maintain that myself. I've been patient for over half a month, and I'm trying to help your tools. Would you like more documentation or something?

toddtarsi avatar May 21 '18 18:05 toddtarsi

@toddtarsi sorry for taking so much to answer this. I've been a bit away from Github because I recently switched jobs and had been a bit busy afterwards. I'll take a look at this today. Sorry for the frustration, will try to avoid it in the future!

leoasis avatar Jun 18 '18 13:06 leoasis

The change looks good, could you please update the docs for this new option and how it works, and also add an example for it? If you want you can put a simple use case for this here as a comment and I can work the example out from that.

leoasis avatar Jun 18 '18 13:06 leoasis

Haha, okay thank you. Sorry I got crazy; I know thats the worst on Github. I'll update that this week. Thanks for the great repo!

toddtarsi avatar Jun 18 '18 14:06 toddtarsi

Sure thing, looking forward to the changes! Glad you found this useful and again sorry to keep you unanswered for so long

leoasis avatar Jun 18 '18 14:06 leoasis

@leoasis - Sorry this took ten years! Updated with documentation. Please review and let me know your thoughts.

toddtarsi avatar Feb 06 '19 19:02 toddtarsi

@leoasis - Hey, just checking in. Wanted to see if this was still on the table.

toddtarsi avatar May 18 '20 17:05 toddtarsi