-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fixed single response and added subscriptions to links #1992
Conversation
@evanshauser, thanks for your PR! By analyzing the history of the files in this pull request, we identified @helfer, @calebmer and @jbaxleyiii to be potential reviewers. |
src/ApolloClient.ts
Outdated
}, | ||
unsubscribe: (id: string): void => { | ||
// wsClient.unsubscribe(id); | ||
}, | ||
}; | ||
} else if ( | ||
networkInterface && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbaxleyiii It would be great to remove the ObservableNetworkInterface here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanshauser do you think we should remove it before 2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbaxleyiii Yeah we never published about it and now that subscriptions-transport-ws contains a request method, the ObservableNetworkInterface breaks subscriptions
CC @DxCx
src/ApolloClient.ts
Outdated
return ''; | ||
}, | ||
unsubscribe: (id: string): void => { | ||
// wsClient.unsubscribe(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a map to keep track of the subscriptions? 2.0 won't have this issue, since the Links will just return an Observable
553efda
to
3abfd04
Compare
Generated by 🚫 dangerJS |
106a7c0
to
700cb68
Compare
subscription.unsubscribe(); | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are still going to override the given apollo-link network interface with an adapter/proxy object,
then IMO we should also keep the original request method.
(add request key as well which will be networkInterface.request.bind(networkInterface))
as internals of the client should start using Observables it will be much easier to start coding towards that,
and then later on remove this legacy adapter object and just keep original apollo-link.
@evanshauser would you be able to resolve these conflicts? I'd love to get a release out to day with these fixes! |
… current interface
a06764d
to
6242e91
Compare
* Fix mistake in README (#1994) The mistake was introduced by 5863eac when consolidating the two examples for `new ApolloClient`. * chore(deps): update dependency remap-istanbul to version 0.9.5 (#1996) * chore(deps): update dependency @types/chai to version 4.0.2 (#1995) * chore(deps): update dependency webpack-bundle-analyzer to version 2.9.0 (#2001) * chore(deps): update dependency ts-jest to version 20.0.9 (#2000) * fixed two queries in flight bug for Apollo Link (#2002) * fixed two queries in flight bug for Apollo Link * Changelog updated * chore(deps): update dependency chai to v4.1.1 (#2003) * chore(deps): update dependency danger to v1.2.0 (#2015) * chore(deps): update dependency lint-staged to v4.0.3 (#2010) * chore(deps): update dependency ts-jest to v20.0.10 (#2009) * Fixed the networkInterface config applying (#2014) * fixing the networkInterface config applying * CHANGELOG added * Fixed single response and added subscriptions to links (#1992) * Fixed single response and added subscriptions to links * remove Observable Network Interface and include subscriptions map for current interface * Subscripitons unit tests and subscribe method calls correctly to handler * Update Changelog to reflect subscriptions with Links * bumped graphql types version and include asynciterable ts library * fix: flow: prevent RequestOptions null error (#2006) * fix: flow: prevent RequestOptions null error * fix: flow: prevent RequestOptions null error (with test) * chore(deps): update dependency tslint to v5.6.0 (#2017) * chore(deps): update dependency sinon to v3.1.0 (#2021) * fix(deps): update dependency apollo-link-core to v^0.4.0 (#2018) * 1.9.1 (#2025) * bump changelog * version bump * import ZenObservable types from apollo-link-core * bump apollo-link-core version number * chore(deps): update dependency @types/lodash to v4.14.72 * chore(deps): update dependency @types/node to v8.0.20 * Setup all-contributors-cli * chore(deps): update dependency webpack to v3.5.2 * chore(deps): update dependency webpack to v3.5.3 * chore(deps): update dependency fetch-mock to v5.12.2 * chore(deps): update dependency all-contributors-cli to v4.4.0 * Fixed flow annotations - [Object] means array of length 1 with Object. Instead we want Array<Object> - ___* were typos. The correct values from code is __* * Fixed fetchMore annotations, make optional covariant * Updated changelog for #2034 * chore(deps): update dependency sinon to v3.2.0 * chore(deps): update dependency rxjs to v5.4.3 * chore(deps): update dependency @types/chai to v4.0.3 * chore(deps): update dependency webpack to v3.5.4 * chore(deps): update dependency @types/node to v8.0.22 * chore(deps): update dependency @types/chai to v4.0.4 * chore(deps): update dependency @types/lodash to v4.14.74 * chore(deps): update dependency @types/node to v8.0.24 * chore(deps): update dependency flow-bin to v0.53.1 * chore(deps): update dependency sinon to v3.2.1 * chore(deps): update dependency webpack to v3.5.5 * chore(deps): update dependency lint-staged to v4.0.4 * chore(deps): update dependency source-map-support to v0.4.16 (#2073) * chore(deps): update dependency @types/mocha to v2.2.42 (#2069) * chore(deps): update dependency uglify-js to v3.0.28 (#2074) * chore(deps): update dependency @types/node to v8.0.25 * chore(deps): update dependency rollup to v0.49.0 * chore(deps): update dependency bundlesize to v0.14.1 * chore(deps): update dependency tslint to v5.7.0 * Use previous results for fields from custom resolvers A logic error was causing the `readStoreResolver` from applying a `previousResult` to a top-level ID obtained via a custom resolver. Effectively, this bug was causing the result of any query routed through a custom resolver to fail reference equality checks, even if the result is served completely from the cache and is completely unchanged. This commit adds a regression test. * chore(deps): update dependency prettier to v1.6.1 * chore(deps): update dependency rollup to v0.49.2 * chore(deps): update dependency @types/node to v8.0.26 * chore(deps): update dependency ts-jest to v20.0.13 * 1.9.2 and prettier updates
Checklist:
Closes #2022