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

Fixed single response and added subscriptions to links #1992

Merged
merged 5 commits into from
Aug 9, 2017

Conversation

evans
Copy link
Contributor

@evans evans commented Aug 3, 2017

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Closes #2022

@mention-bot
Copy link

@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.

},
unsubscribe: (id: string): void => {
// wsClient.unsubscribe(id);
},
};
} else if (
networkInterface &&
Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

@evans evans Aug 3, 2017

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

return '';
},
unsubscribe: (id: string): void => {
// wsClient.unsubscribe(id);
Copy link
Contributor Author

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

@evans evans force-pushed the link-subscriptions branch from 553efda to 3abfd04 Compare August 3, 2017 20:55
@apollo-cla
Copy link

apollo-cla commented Aug 3, 2017

Messages
📖

Please add your name and email to the AUTHORS file (optional)

📖

If this was a change that affects the external API, please update the docs and post a link to the PR in the discussion

Generated by 🚫 dangerJS

@evans evans force-pushed the link-subscriptions branch from 106a7c0 to 700cb68 Compare August 9, 2017 06:52
subscription.unsubscribe();
}
}
},
Copy link
Contributor

@DxCx DxCx Aug 9, 2017

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.

@jbaxleyiii
Copy link
Contributor

@evanshauser would you be able to resolve these conflicts? I'd love to get a release out to day with these fixes!

@evans evans force-pushed the link-subscriptions branch from a06764d to 6242e91 Compare August 9, 2017 18:06
@jbaxleyiii jbaxleyiii merged commit 2433f1d into master Aug 9, 2017
@jbaxleyiii jbaxleyiii deleted the link-subscriptions branch August 9, 2017 19:22
jbaxleyiii pushed a commit that referenced this pull request Sep 4, 2017
* 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants