Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Query composition #100

Closed
tlvenn opened this issue Jul 11, 2016 · 7 comments
Closed

Query composition #100

tlvenn opened this issue Jul 11, 2016 · 7 comments
Assignees
Labels

Comments

@tlvenn
Copy link

tlvenn commented Jul 11, 2016

Similarly to how query composition works in Relay, it would be neat to be able to compose queries using fragments defined in child components.

A good overview on how Query composition is handled by Relay:

http://stackoverflow.com/questions/33095479/how-does-query-composition-work-between-a-container-and-a-route-in-relay

@tlvenn
Copy link
Author

tlvenn commented Jul 11, 2016

Another interesting read: facebook/relay#309

@jbaxleyiii
Copy link
Contributor

@stubailo I'd love to get your thoughts on this as well

@stubailo
Copy link
Contributor

Just shipped some docs about this! http://docs.apollostack.com/apollo-client/fragments.html Perhaps we should add something React-specific to the docs as well, like attaching fragments as static properties on the components?

@jbaxleyiii
Copy link
Contributor

@stubailo I'm planning on adding an API for attaching fragments to components in the 0.4.0. I still need to work on the API. @tlvenn or @stubailo do you have a sample where this would be helpful?

@jbaxleyiii jbaxleyiii self-assigned this Jul 21, 2016
@jbaxleyiii jbaxleyiii added this to the 0.4.0 milestone Jul 21, 2016
@stubailo
Copy link
Contributor

Right now the most helpful situation for me is if I have a query and a mutation that updates the query. Since I need to fetch the same fields in both, I'd like to use a fragment.

I think one thing that could be sad though is if you have to make a container or something heavy just to attach a fragment. I feel like ideally it could just be a static React component property or something?

@jbaxleyiii jbaxleyiii removed this from the 0.4.0 milestone Aug 12, 2016
@jbaxleyiii
Copy link
Contributor

Related: #122

@jbaxleyiii
Copy link
Contributor

Closing in favor of common discussion in #140

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants