Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo #13

Merged
merged 30 commits into from
Nov 17, 2016
Merged

Apollo #13

merged 30 commits into from
Nov 17, 2016

Conversation

richburdon
Copy link
Contributor

Hopefully you're not reading this kind of thing at the moment. Not least of the reasons being that I have to admit your curiosity about Apollo was well founded. It is so much simpler and straight-forward than Relay.

Although again I had to reverse engineer it to understand it properly (although the docs are much better):

https://github.com/alienlaboratories/react-demos/blob/051801ba75e9c79c5320f2e807edddd0b5566e75/docs/kbase/apollo.png

I have most of the technical functionality of the relay demo (and more) now working (queries with fragments, mutations, paging, network interface, etc.) The killer feature is of course Redux; I had talked myself out of needing it (Relays docs imply it's obsolete and it's quite complicated), but I think essential.

I found a few bugs too, but got quick responses from the team.

I'll write up a summary (currently https://github.com/alienlaboratories/react-demos/blob/051801ba75e9c79c5320f2e807edddd0b5566e75/sub/apollo/js/client/main.js).

On a meta level:
a) I think my desire to get something working really exacerbates the cognitive load of really absorbing these frameworks (GraphQL, then Relay, then Native and now Redux and Apollo).
b) I discounted Apollo having the potential resources/support of Relay. Yet Relay 2 doesn't inspire much confidence.

BTW, on the side, I completed the stories (team roster and delete); but the inscrutable nature of Relay's caching system (and abundant problems given mutations) made me want to explore Apollo thoroughly. I think I can probably port the entire current app from Relay in a 5-story (2 days) so am inclined to do that -- esp. since in some respects (caching, queries) I'm further ahead in Apollo at this point.

RB

Redux integration (next step to wire Search box to Redux state => update query).
Client logging of request/response using network interface middleware.
// Called after optimisticResponse and once mutation has been returned from server.
// https://github.com/apollostack/apollo-client/issues/621
// http://dev.apollodata.com/react/cache-updates.html#updateQueries
updateQueries: {
Copy link
Contributor Author

@richburdon richburdon Nov 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutations can provide optimistic results and affect the current query.
Here, I'm using the server side Item Matcher to filter the currently cached results against the mutated item.

This doesn't affect other cached query results (i.e., result sets for this same component with different filter variables).

Which is currently under discussion... (as of October)
apollographql/apollo-client#621

Using npm-workspace and webpack-link to configure sub node modules (e.g., import { TypeUtil } from 'minder-core');
Starting to factor out core client/server code to sub/core
Start to move graphql (and server) to sub/graphql (under webpack)
Clean-up of UX/rendering/logging.
@adamberenzweig
Copy link
Contributor

Finally read this, thanks for the notes here.

On Fri, Nov 11, 2016 at 7:51 PM, Rich Burdon [email protected]
wrote:

Hopefully you're not reading this kind of thing at the moment. Not least
of the reasons being that I have to admit your curiosity about Apollo was
well founded. It is so much simpler and straight-forward than Relay.

Although again I had to reverse engineer it to understand it properly
(although the docs are much better):

https://github.com/alienlaboratories/react-demos/blob/
051801b/docs/kbase/apollo.png

I have most of the technical functionality of the relay demo (and more)
now working (queries with fragments, mutations, paging, network interface,
etc.) The killer feature is of course Redux; I had talked myself out of
needing it (Relays docs imply it's obsolete and it's quite complicated),
but I think essential.

I found a few bugs too, but got quick responses from the team.

I'll write up a summary (currently https://github.com/
alienlaboratories/react-demos/blob/051801ba75e9c79c5320f2e807eddd
d0b5566e75/sub/apollo/js/client/main.js).

On a meta level:
a) I think my desire to get something working really exacerbates the
cognitive load of really absorbing these frameworks (GraphQL, then Relay,
then Native and now Redux and Apollo).
b) I discounted Apollo having the potential resources/support of Relay.
Yet Relay 2 doesn't inspire much confidence.

BTW, on the side, I completed the stories (team roster and delete); but
the inscrutable nature of Relay's caching system (and abundant problems
given mutations) made me want to explore Apollo thoroughly. I think I can
probably port the entire current app from Relay in a 5-story (2 days) so am
inclined to do that -- esp. since in some respects (caching, queries) I'm
further ahead in Apollo at this point.

RB

You can view, comment on, or merge this pull request online at:

#13
Commit Summary

  • Apollo app with list query.
  • Clean-up
  • Apollo Search List.
  • Mutations.
  • Fragments.
  • Devtools
  • Paging/cursors.
  • Issue filed for paging bug.
  • Workaournd for paging bug.

File Changes

Patch Links:


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#13, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAWAUaoZ7lmcqwlsuxb61ZrKDw03zFazks5q9Q2kgaJpZM4KwRjG
.

@richburdon richburdon merged commit c9e8f3e into master Nov 17, 2016
@adamberenzweig
Copy link
Contributor

This is awesome. I'm psyched you're happy about Apollo and it looks like
you've got some deep magic here already.

On Wed, Nov 16, 2016 at 7:23 PM, Rich Burdon [email protected]
wrote:

Merged #13 #13.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWAUecaSe7xKIF0tbIT7HcihKQoIlJjks5q-56XgaJpZM4KwRjG
.

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

Successfully merging this pull request may close these issues.

2 participants