0

I'm trying to get a demo running using relay for the first time. I have my Relay compiler running ok and my relay graphql files generating, but when I run the application I get the following error:

Uncaught Invariant Violation: Could not create Relay Container for `EntityRow`. The value of fragment `kind` was expected to be a fragment, got `Fragment` instead.

The fragment in the 'EntityRow' is as follows:

export default createFragmentContainer(EntityRow, graphql`
fragment EntityRow_someEntity on SomeEntity {
    id
    title
    description
}`);

This component renders an single entity. The next component up the tree then is the EntityList component, whose fragment is:

 export default createFragmentContainer(EntityList, graphql`
 fragment EntityList_viewer on SomeEntity  {
      ...EntityRow_someEntity
 }

`)

Finally, the root of the component tree then:

const AppRootQuery = graphql`
query RelayDemoQuery {
  entity {
    ...EntityList_viewer
  }
}`

return (
  <QueryRenderer
    environment={relayEnvironment}
    query={AppRootQuery}
    ...... />

In my generated EntityRow_entity.graphql.js file the value of node.kind is 'Fragment', but Im assuming this is correct and the error is a bit of a red herring and something else is wrong?

Stewart Alan
  • 1,521
  • 5
  • 23
  • 45

0 Answers0