Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upObservable query refactor #211
Conversation
tmeasday
added
the
in progress
label
Sep 14, 2016
This comment has been minimized.
This comment has been minimized.
Also some of the commits you may want to cherry pick, especially e2b9587 |
tmeasday
reviewed
Sep 14, 2016
@@ -496,13 +496,16 @@ export interface UpdateQueryOptions { | |||
} | |||
export class ObservableQuery extends Observable<ApolloQueryResult> { | |||
refetch: (variables?: any) => Promise<ApolloQueryResult>; | |||
setVariables: (variables: any) => Promise<ApolloQueryResult>; |
This comment has been minimized.
This comment has been minimized.
tmeasday
Sep 14, 2016
Author
Contributor
I manually copied this over from apollo-client
-- I'm not sure what the correct procedure is.
tmeasday
reviewed
Sep 14, 2016
@@ -1209,7 +1232,7 @@ describe('queries', () => { | |||
this.props.data.updateQuery(); | |||
done(new Error('should have thrown')) | |||
} catch (e) { | |||
expect(e).to.match(/Invariant Violation:/); | |||
expect(e).to.match(/ObservableQuery with this id doesn't exist:/); |
This comment has been minimized.
This comment has been minimized.
tmeasday
Sep 14, 2016
Author
Contributor
There's no longer an invariant check here because it goes straight through to AC, but I think the error is OK? I'm not sure. We can definitely improve the error at AC's end anyway.
tmeasday
reviewed
Sep 14, 2016
} else if (count === 1) { | ||
expect(props.data.variables).to.deep.equal(variables2); | ||
expect(props.data.variables).to.deep.equal(variables); |
This comment has been minimized.
This comment has been minimized.
tmeasday
Sep 14, 2016
Author
Contributor
fetchMore
is not going to change data.variables
anymore, but I think this is more correct, no? (the variables for fetchMore
might be completely different to those for the original query).
This comment has been minimized.
This comment has been minimized.
@jbaxleyiii I think this is more or less done as I was hoping now. When you have a moment to look at this could you take a look? I'll wait for your approval before merging the changes to AC and ultimately these into RA. Also, you would have seen apollographql/apollo-client#707 which is relevant and something I'll look at soon. |
This comment has been minimized.
This comment has been minimized.
@tmeasday |
tmeasday
added some commits
Sep 12, 2016
tmeasday
force-pushed the
observableQuery-refactor
branch
from
90e5e3e
to
16dece1
Sep 30, 2016
tmeasday
changed the title
Observable query refactor [WIP]
Observable query refactor
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
@tmeasday I totally missed your rebase! I'm super sorry! I'll rebase it after the recent changes! |
This comment has been minimized.
This comment has been minimized.
@tmeasday |
Oct 8, 2016
added some commits
jbaxleyiii
merged commit 246eca0
into
master
Oct 8, 2016
5 checks passed
jbaxleyiii
deleted the
observableQuery-refactor
branch
Oct 8, 2016
This comment has been minimized.
This comment has been minimized.
@tmeasday fantastic work! |
This comment has been minimized.
This comment has been minimized.
Wow this is crazy! Awesome. |
tmeasday commentedSep 14, 2016
•
edited
@jbaxleyiii this is just a first pass for you to look at, still a bit more to do (see XXXs in code and some notes I will leave now).
I welcome any comments you have at this stage though!
(Note that this branch runs with the
add-observable-query-current-result
branch of AC)