-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement FieldMerge and FieldMergeFunction #144
Implement FieldMerge and FieldMergeFunction #144
Conversation
module FieldMergeFunction = { | ||
module Js_ = { | ||
type t | ||
} | ||
type t = Js_.t | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to move this type further down in the module to share the FieldFunctionOptions.t
type.
I'd have to look close at the typescript types, but on first glance this looks great.
As long as you're keeping with the style of the rest of the library you can't. This is the cost of (what I considered at the time) a better API. So we can do stuff like |
Unfortunately that nesting breaks the feature. Apollo doesn't recognize the merge function and nothing happens. I need a way for the function to be assigned directly, without the My understanding of |
I think the unboxed portion is working fine. The I think that the actual issue is that line 124 needs to be typed as a - let mergeFunction = (v: FieldMergeFunction.t<'existing>) => Any(v)
+ let mergeFunction = (v: FieldMergeFunction.Js_.t<'existing>) => Any(v) That will then force you to call |
Aah, ok. I fixed those references, but still am seeing the One additional issue- the |
In the compiled file where you configured your client (what you showed previously), you should still be seeing What have you tried in debugging the issue so far? Does a debugger in your merge function get called? You could also put some debuggers in |
Oh got it- I missed the fact that the toJs step happens afterwards. Turns out my issue was with |
Excellent! I really appreciate you putting in the PR. I'll merge and cut a release soon. |
I feel like this is pretty close. Something's wrong with the
@unboxed
though:Compiles to
How can I get rid of that extra
merge: { _0: incomingMerge }
?