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

Apollo Nested Comments Thread #1489

Closed
5 tasks done
SachaG opened this issue Oct 29, 2016 · 2 comments
Closed
5 tasks done

Apollo Nested Comments Thread #1489

SachaG opened this issue Oct 29, 2016 · 2 comments
Labels

Comments

@SachaG
Copy link
Contributor

SachaG commented Oct 29, 2016

🤔 What you will need to know

Meteor, React, Apollo, and GraphQL.

🎯 The Goal

Recreate Telescope's Reddit-style nested comment threads with Apollo.

There are basically two approaches:

  1. Load all of a post's comments and nest them on the client.
  2. Perform the nesting in GraphQL and only load the first three levels of nesting (better).

📋 Step by Step

  • Claim this issue.
  • ...
  • Test if it works.
  • Open a PR to devel branch, mentioning this issue.
  • Someone else: review & merge! 🎉

Ping us here, in the Telescope Slack room or on Twitter if you have any questions 😉

@SachaG
Copy link
Contributor Author

SachaG commented Oct 29, 2016

Some insights from @helfer:

let me think for a second about the nested comments.

depending on how you want to represent that nesting, and what you want to show at the beginning (before having expanded anything), I think you’ll want different ways of loading it on the server.

the most straightforward way in the GraphQL schema would be to give each comment a nested_comments field, and then just fetch those documents with a resolver.

then the fetchMore could simply use a query that accesses more comments from that particular document.

if you want to load everything at once, you could do that as well (with a special loader), but still access them in a nested fashion.

I guess I’d need some more specifics to know what the best way is. But there’s definitely a lot of possibilities with GraphQL, and they can be made efficient as well

See also: graphql/graphql-spec#91

@SachaG SachaG added the apollo label Oct 29, 2016
@xavxyz
Copy link
Member

xavxyz commented Nov 10, 2016

👏 🚀

@xavxyz xavxyz closed this as completed Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants