#relay modern: Testing queries.
▻https://hackernoon.com/relay-modern-testing-queries-8abf400194bc?source=rss----3a8144eabfe3---4
In previous stories I shared my thoughts on how to test #react components and #graphql, now it is Relay’s turn. Relay is a great data-manager from Facebook. You can find some information about it in my previous stories. Let’s start.Corner casesThe main corner case in using Relay is that any query you are using might be changed over time and you won’t find it out unless you try to compile relay. If you don’t compile and try to run a query which fetches a field and that field no longer exists on the server you will get an error saying that: “Cannot query field \”firstName\” on type \”User\”.”.I bet you don’t want to have that, so don’t I. That is why I decided to test relay queries. A relay query looks exactly how a graphql query does.SolutionWe need to execute a query against a graphql schema to (...)