-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add relay mocking to storybook router #1065
Conversation
Deploy preview for artsy-reaction ready! Built with commit a81d58f |
Query: () => ({ | ||
me: { | ||
name: "Alice Jane", | ||
}, |
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.
Nice and simple
Off topic: when pairing you should consider using git’s signed-off-by feature. I think @xtina-starr and @yuki24 even use a convenient tool for that. |
I believe this is the tool they use: https://github.com/git-duet/git-duet |
<StorybooksRouter | ||
routes={orderRoutes} | ||
initialRoute="/order2/123/shipping" | ||
mockResolvers={{ |
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.
In a follow up PR I think the API for this can be cleaned up to just
<StorybooksRouter
routes={ ... }
route={ ... }
resolvers={ ... }
state={ ... }
/>
Right now it seems like the initial
and mock
prefixes add unnecessary noise.
@@ -0,0 +1,13 @@ | |||
import { IResolvers } from "graphql-tools/dist/Interfaces" |
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.
Interesting -- I wonder if the I<Name>
idiom is coming back 🤔
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.
Nooooooooooooooooo
(it's actually the default in tslint, we always turn it off)
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.
Yeah, please no; we’re not 🤖s but 👩🎨 & 👨🎨!
LGTM 👍 I'm excited that we now have a solid testing path, too, though I think we might want to rename |
This adds the ability to mock up a Relay response in the
StorybookRouter
(and in other places) to be able to get responses without needed to rely on metaphysics staging.