This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Add generic types for updates #75
Labels
Comments
Was meant to post almost exactly that.
|
@jBugman Thanks for the workaround, that works (and is nicer than just |
We could add a generic here: https://github.com/FormidableLabs/urql-exchange-graphcache/blob/master/src/types.ts#L69 Not entirely sure if that could solve all use cases but I'll dig into that later. |
@JoviDeCroock Looks like that could solve the issues, thank you. 🙏 |
Hmm thinking about it further, TS won't allow it being set there. Will have to dig deeper into this. Sorry about that hadn't given it enough thought yet |
No problem, it's not a blocking issue, but I think this would be a great addition 🙂 |
kitten
added
feature 🚀
New feature or request
help wanted ⛏️
Extra attention is needed
labels
Sep 16, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have the following code (in
updates.Mutation
) to update a list count after creating an item:There's currently no validation / hints on
variables
ordata
, which should be possible by passing the respective types as generics toupdateQuery
(similar to howuseQuery
/useMutation
hooks work).I also get a typescript error on
data.parent.items
:It would also be great to have the possibility to type the whole function
createItem
, so we could have validation / hints onargs
andresult
as well.Right now I get another typescript error on
args.input.parent
:The text was updated successfully, but these errors were encountered: