I'm getting data returned from my server correctly, but I'm getting a prop not supplied error.
~ expected prop `query` to be supplied to `Relay(ContactsPage)`, but got `undefined`.
With the following.
import makeRouteConfig from 'found/lib/makeRouteConfig';
import Route from 'found/lib/Route';
import React from 'react';
import { graphql } from 'react-relay';
import ContactsPage from '../components/ContactsPage';
export default makeRouteConfig(
<Route
path="/contacts"
Component={ContactsPage}
prepareVariables={ (params) => ({
...params,
count: 5,
order: "title",
postType: ['mp_contact'],
})}
query={graphql`
query contacts_WPQuery_Query(
$count: Int!
$order: String!
$cursor: String
$categoryName: String
$postType: [String]
) {
...ContactsPage_query
}
`}
/>
);
I can see that data is fetched from the server.
And I have other components following similar patterns that work :/ This is the ContactsPage component
import React, { Component } from 'react'
import ContactsList from './ContactsList'
import { createFragmentContainer, graphql } from 'react-relay'
class ContactsPage extends Component {
render() {
const {query} = this.props
return (
<div>
<ContactsList wp_query={query.wp_query} />
</div>
)
}
}
export default createFragmentContainer(
ContactsPage,
{
query: graphql`
fragment ContactsPage_query on Query {
wp_query {
id
...ContactsList_wp_query
}
}
`
}
)