I seem to be unable to get past this problem. I have reduced the code to a minimum now and still it happens. It is currently just QueryRenderer and PaginationController.
I get the correct response from GraphQL-server when I check at the Fetch-level. But it doesnt get added to the props. I am unable to add even the first lines in the beginning.
As far as I (and my colleagues) can see we are following the sample code. I guess I am doing something wrong begause I get the following warning ('mmk' is my name for the props-data - I always get mmk: null
I do get the full relay package in the props. It is just the data that gets lost somewhere, WorkspaceList is my React-class.
Warning: createFragmentSpecResolver: Expected prop mmk to be supplied to Relay(WorkspaceList), but got undefined. Pass an explicit null if this is intentional.
__stack_frame_overlay_proxy_console__
Sounds like the same thing I'm experiencing. I reported this at the end of issue #1928. This happens when the initial query (passed to my QueryRenderer) includes the fragment defined in my PaginationContainer. If I instead expand that fragment in the initial query, the data appears in the props, however I get the warning stating that a fragment was expected.
Thanks, that is exactly how I am doing it right now. I'm going to look more at this today.
I tried debugging this a bit. It looks like something might be getting lost when the response payload is normalized. Haven't been able to debug deeper than this yet.
Looks like this might also be the same issue as reported in #1920. Although I tried reverting to react-relay 1.0.0 and it didn't resolve the problem.
I also tried 1.0.0 without any success. I can see the data is loaded into the relay store. It just wont connect with the props with the warning I detailed in the first message. I am also running with a really simple project right now. It is probably something I鈥檝e overlooked
@janlarsson Whatever it is, it seems like a few of us are overlooking the same thing ;-)
@blevine True, and I would feel much more at ease if there were working sample code to build and play with. Modern + Pagination - I have not found anything.
I get the same problem (and the same warning) with both RefetchContainer and PaginationContainer. Data from server o.k. and it can be found in the relay store when I poke around but it is not wired up to the props as it should (get a null instead).
The function that warns is imported from the reassuringly named 'internal_unstable'
Warning:
Warning: createFragmentSpecResolver: Expected prop xyzzy to be supplied to Relay(Adventures), but got undefined. Pass an explicit null if this is intentional.
Please see the latest comments in #1928. I was able to get things working following the suggested changes. The weird thing is that (even with the suggested changes) when I debug into my top-level component's render() method, the prop I'm looking for isn't populated. But when I debug into the child PaginationContainer's constructor, I then see the prop.
So if you have a top-level component "foo" and child component "bar", you have to pass this.props.foo to the child component and access this.props.foo.bar there because this.props.foo.bar doesn't exist in the parent component.
I don't know whether this is a bug in relay or not. It seems to me that the child component should only know about "bar." It shouldn't know anything about its parent component or its parent component's properties. I may post something on this in StackOverflow.
@blevine Thank yoyu!
After reading #1920, #1928 and the documentation three times I got it at last. A few changes and everything worked.
Most helpful comment
@blevine True, and I would feel much more at ease if there were working sample code to build and play with. Modern + Pagination - I have not found anything.