Type Helpers #2193
Unanswered
BoilerTom90
asked this question in
Q&A
Type Helpers
#2193
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found the need in my angular app to use the apolloCache.updateQuery function. I wrote a small wrapper to the function so that it can be called and use for any of our queries. However, it's currently not type safe.
My updateQuery wrapper is currently only going to work for one of our graphql queries, such as this one:
My updateQuery wrapper assumes the structure of the OpResult, MyVars and MyQueryDoc. What I'd like to be ale to do is create some typescript type helps that given a specific
MyQuery
, it can extract or infer MyOpResult, MyVars, and MyQueryDoc, and I can then use those types to provide some type safety to my updateQuery wrapper.Two questions:
Beta Was this translation helpful? Give feedback.
All reactions