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

Is it possible to convert parsed result back to the original type? #87

Open
MargaretKrutikova opened this issue Aug 24, 2019 · 1 comment

Comments

@MargaretKrutikova
Copy link

I am using graphql_ppx with reason-apollo and I am struggling with cache updates in apollo. The objects in cache are plain JS objects, that are parsed when read from the cache, so that they are converted to records if using @bsRecord and all @bsDecoder directives are applied too.

However, when writing back to cache I need to convert the object to the original structure since cache wants plain JS objects with all their field values intact, so that they are properly converted next time the query is read from cache.

Is there any way to convert the parsed object back to the original response type?

@baransu
Copy link
Contributor

baransu commented Aug 27, 2019

I'm struggling with it too. There is #71 but no one is actively working in this repo on this. I have graphql_ppx_re which is Reason version of this ppx with work in progress branch trying to implement such feature. Help is welcome :)

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

2 participants