lvarayut / relay-fullstack

:point_up::running: Modern Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS
https://lvarayut.github.io/relay-fullstack/
MIT License
985 stars 126 forks source link

Queries not working in children components #90

Closed fameoflight closed 7 years ago

fameoflight commented 7 years ago

Any idea why you need to explicitly pass viewer to Footer rather than it picking it up from FooterContainer

https://github.com/lvarayut/relay-fullstack/blob/master/client/components/App/AppComponent.js#L28

Neitsch commented 7 years ago

Have you tried removing it? It might just be an error on my part. I'll have a look in the next days.

fameoflight commented 7 years ago

Yeah i did try removing it it didn't work.

On Sun, May 28, 2017, 3:32 PM Nigel Schuster notifications@github.com wrote:

Have you tried removing it? It might just be an error on my part. I'll have a look in the next days.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lvarayut/relay-fullstack/issues/90#issuecomment-304544618, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8EiMAeYJED-ga3xgdiMz_1yePP0RWeks5r-fYPgaJpZM4Nouc1 .

Neitsch commented 7 years ago

Ah, actually the code is right. Relay does not inject props. It's mostly used for queries. See a similar Todo example. https://github.com/relayjs/relay-examples/blob/master/TodoMVC/components/TodoList.js

fameoflight commented 7 years ago

@Neitsch is there any way to make queries work in children components I thought the whole point of relay was to keep queries near to component. This kind of break that paradigm.

Neitsch commented 7 years ago

The query still does it's job and is right by the component. It's all more about what attributes will be fetched / needed and whether to rerender.