-
-
Notifications
You must be signed in to change notification settings - Fork 312
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 Angular 4.0 QueryRef.fetchMore
parameter typings remove updateQuery
property
#1810
Comments
Finding that this typing issue still exists in release 4.1.0, I investigated further and found that while |
@KeithGillette I have a dynamic helper that creates a dynamic updateQuery: (prev, { fetchMoreResult }) => {
if (!fetchMoreResult) {
return prev;
}
const newEdges = fetchMoreResult[this.connectionFieldName].edges;
if (newEdges.length === 0) {
return prev;
}
return {
[this.connectionFieldName]: {
...fetchMoreResult[this.connectionFieldName],
edges:
this.direction === Direction.ASCENDING
? [...prev[this.connectionFieldName].edges, ...newEdges]
: [...newEdges, ...prev[this.connectionFieldName].edges],
},
};
}, Are you telling me that we now need to go to our cache adaptor and add type policy for each individual connection. We have hundreds of them and each one is 'owned' by a particular service which is agnostic to the cache o.o |
Hi, @alfaproject — Well, so far as I can see, |
@KeithGillette I also do the same as you with respect to a dynamic helper.... I cant seem to figure out get a simple policy merge working let alone a dynamic one have you? For now I put in the a @ts-ignore and im working fine on the latest but somehow need to figure out this policy merge. My existing super simple merge that works fine.
I would think something like this would work.. but incoming is always null and not iterable
|
@jwrascoe — I'm not sure why the |
@KeithGillette -- yes its strange, I have been using Apollo since its early inception against a postgres via PostGraphile and have never had a situation like this before, perhaps its related to how edges are returned or that I am calling only with a limit and offset from a cursor So strange... --Forgive me on the formatting.. not sure why its getting messed up in git fetchDataMore() { query allProductsByClientIdForSearchMore( ) { |
Describe the bug
Upgrading from
[email protected]
to[email protected]
produces TS2345 error on code which passes anupdateQuery
property to thefetchMoreOptions
parameter of aQueryRef.fetchMore
call.To Reproduce
Previously, the
QueryRef.fetchMore
fetchMoreOptions
parameter was typed withFetchMoreQueryOptions
&FetchMoreOptions
but Apollo Angular 4 removedFetchMoreOptions
and with it theupdateQuery
property on the parameter.Expected behavior
The method signature should not change, since the underlying Apollo Client
ObservableQuery.fetchMore
method still hasupdateQuery
in its signature.Environment:
Additional context
That pretty much sums it up.
The text was updated successfully, but these errors were encountered: