How to fix 'rule is not a function' error

15 June, 2018

We recently had this really descriptive error at work: rule is not a function

The error boils down to Facebook engineers breaking compatibility with graphql 0.12.x in certain versions of Relay.

The fix

Bump your GraphQL and Relay versions - in package.json we set our versions to:

  • graphql to 0.13.2
  • relay to 1.6

Source: https://github.com/facebook/relay/issues/2428


Enjoyed this post? Receive the next one in your inbox!


Previous: Tips for making Server-side rendering in React easy*

Next: Side Projects: Another one