subscribeToMore bad documentations and typescript type annotations
See original GitHub issueIntended outcome: According to new docs about subscriptions: https://www.apollographql.com/docs/react/features/subscriptions.html#subscribe-to-more
Data about new comment should be found in
subscriptionData.data.commentAdded
Typescript annotation for subscriptionData is
subscriptionData: { data: any }
Actual outcome:
But data about new comment are direcetly in subscriptionData like this:
subscriptionData.commentAdded
Typescript annotation for subscriptionData should be according to data something like
subscriptionData: any
How to reproduce the issue: Try subscription example from docs.
Version
- apollo-client@<2.0.1>
- react-apollo@<2.0.0>
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Complete Rewrite of ESLint | Hacker News
You're wrong. TypeScript allows annotating types within JSDoc comments, and knows how to read it. Writing in JavaScript and using TypeScript ...
Read more >Generate GraphQL Types with Apollo Codegen Tutorial
In this post, you'll learn how to use Apollo's GraphQL codegen to generate TypeScript types for GraphQL operations in your Apollo Client ...
Read more >open-source-community/apollographql-react-apollo
Easy to use, human readable and machine processable release notes for everyone. ... Documentation updates. ... Various Typescript type changes.
Read more >Release notes - OpenTok.js | Vonage Video API Developer
Release notes for the OpenTok.js library ... See the documentation for the Session. ... Poor background blur performance on certain devices.
Read more >Using React.Components with apollo-client and TypeScript
The graphql type annotation takes <ParentProps, QueryResponse, Variables> . You're passing it graphql<ArticlesFeedResponse ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looking at the olds docs (https://s3.amazonaws.com/apollo-docs-1.x/subscriptions.html#subscribe-to-more)
subscribeToMore
should return{ data, errors }
. Therefore I think this was a bug that I introduced in the 2.0 and should be fixed as such!If anyone wants to open a PR I’d be thrilled to review and merge, otherwise I will add it to my list for this week.
Thanks to @dnalborczyk , @DxCx and @cesarsolorzano for chiming in here and to @JozefBiros for opening this issue!
@DxCx I’m not quite sure if I’m following. I’m mainly wondering if the above change was intended, which is fine with me, other than the docs seem to be wrong - or otherwise it might need to be fixed before a broader adoption of v2.0.