Replies: 1 comment 1 reply
-
Slightly unrelated to your question, but just to mention. I highly recommend not to use |
Beta Was this translation helpful? Give feedback.
-
Slightly unrelated to your question, but just to mention. I highly recommend not to use |
Beta Was this translation helpful? Give feedback.
-
Hello all,
I recently used the
@urql/storybook-addon
to provide fake data to my stories. I was wondering if there is a way to leverage the types I already have thanks to@graphql-codegen/typescript-urql
in order to provide data that are type-checked against the typed operations I use in the story.I made a few helpers in order to manipulate the types and extract the interesting bits, but I'm still unsatisfied with the result, I still need to have type casting in some places.
Here is the data for a story having both a subscription and a mutation :
Here is all the helpers (I'm not a TS wizzard 🧙♂️ ) : https://gist.github.com/jgoux/1573f2730cf34d021c1e263c74f7c926
Maybe I'm overthinking it 😅
Beta Was this translation helpful? Give feedback.
All reactions