denvned / isomorphic-relay

Adds server side rendering support to React Relay
BSD 2-Clause "Simplified" License
242 stars 53 forks source link

Example todo app has 'Invariant Violation: RelayQueryNode: Abstract class cannot be instantiated' #64

Closed CaseyLeask closed 4 years ago

CaseyLeask commented 7 years ago

Tracking down https://github.com/denvned/isomorphic-relay-router/issues/66, I discovered I also get the same error in the isomorphic-relay application.

While the error comes out of Relay, it comes out of this project through https://github.com/denvned/isomorphic-relay/blob/0e0840d129bb62f785159fd969ae546274f8650f/src/prepareData.js#L34-L35 When it calls root.getChildren(), it crashes.

In the example todo app, that will be

import rootContainerProps from './rootContainerProps';

const GRAPHQL_URL = `http://localhost:8080/graphql`;

const networkLayer = new Relay.DefaultNetworkLayer(GRAPHQL_URL);

IsomorphicRelay.prepareData(rootContainerProps, networkLayer);