question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

subscribeToMore bad documentations and typescript type annotations

See original GitHub issue

Intended 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:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jbaxleyiiicommented, Nov 6, 2017

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!

1reaction
dnalborczykcommented, Nov 2, 2017

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found