Designing GraphQL components for testability #768
Unanswered
nareshbhatia
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Curious to get an opinion from this group about GraphQL component design for testability.
As you may know, GraphQL recommends querying for data inside presentational components. While msw makes it easier to test such components by not having to mock the network layer, I am still not comfortable coupling presentational components to data fetching code. Not only does testing becomes harder, even developing the component in Storybook becomes harder, e.g. how do you show a component in its loading state. If we separate the data fetching concern to a
Container
component all these issues go away.What practice do you follow when designing GraphQL components?
Beta Was this translation helpful? Give feedback.
All reactions