target / goalert

Open source on-call scheduling, automated escalations, and notifications so you never miss a critical alert
https://goalert.me
Apache License 2.0
2.17k stars 230 forks source link

storybook: allow for per-story graphql mocking #3899

Closed mastercactapus closed 1 month ago

mastercactapus commented 1 month ago

Description: Adds support for a new parameter graphql which allows specifying payloads for named GraphQL operations. Works per-story.

The decorator was updated so that each component/story renders with it's own unique prefix path to the /api/graphql endpoint, and it's handlers are registered only for that component.

Under the hood it continues to use msw with the following benefits:

This change allows for stories to display/test different GraphQL response states per story without having to rely on conditional returns and interaction