Apollo-link: request a comprehensive tutorial for creating custom link

Created on 18 Jan 2018  路  1Comment  路  Source: apollographql/apollo-link

Apollo Link is super awesome, but there is a deep learning curve when creating an custom link. Although I got some experience in using rxjs because of my angular background (I have no problem in creating observable, chaining among operators), I found it's extremely hard to understand the source code for most of the pre-defined links. Says, in many pre-defined links, forward(operation) itself is a observable, but it always wraps inside an observable.create function with some extra inconceivable subscription. The document seems not very helpful on these. So may i sincerely request the Apollo team to hold some tutorials (Blog, video), explaining some pre-defined links? I believe strengthen the ability of the apollo's community can help to strengthen the apollo project. ^.^

Most helpful comment

This sounds interesting and I'd love to be able to work on this.

At the moment, I think there are a few different resources that one can read through in order to get a general understanding of how links work:

  1. Creating a data component with Apollo Link
  2. Apollo Link: The Modular Network Stack
  3. Apollo Link: Creating your Custom GraphQL Client
  4. The Apollo Link Docs.

For the most part, these explain how to use Apollo Link rather than how the specifics of a particular implementation might work. I agree it would be very useful to have a tutorial that describes how to write a link, or a "literate programming" sort of thing on one of the existing implementations.

I am leaning toward a literate guide to one of the Link implementations, something a bit like this but probably styled a bit more nicely (e.g. comments within a sidebar instead of inline). It could go into detail about the abstractions used without assuming much more than an ES6 background and link to other resources for widely accepted patterns (e.g. observables). Would this be useful?

I am a bit concerned that since the implementation style for links may change over time (while the API might stay the same), this documentation will become stale pretty quickly. Any thoughts on this would be welcome too.

>All comments

This sounds interesting and I'd love to be able to work on this.

At the moment, I think there are a few different resources that one can read through in order to get a general understanding of how links work:

  1. Creating a data component with Apollo Link
  2. Apollo Link: The Modular Network Stack
  3. Apollo Link: Creating your Custom GraphQL Client
  4. The Apollo Link Docs.

For the most part, these explain how to use Apollo Link rather than how the specifics of a particular implementation might work. I agree it would be very useful to have a tutorial that describes how to write a link, or a "literate programming" sort of thing on one of the existing implementations.

I am leaning toward a literate guide to one of the Link implementations, something a bit like this but probably styled a bit more nicely (e.g. comments within a sidebar instead of inline). It could go into detail about the abstractions used without assuming much more than an ES6 background and link to other resources for widely accepted patterns (e.g. observables). Would this be useful?

I am a bit concerned that since the implementation style for links may change over time (while the API might stay the same), this documentation will become stale pretty quickly. Any thoughts on this would be welcome too.

Was this page helpful?
0 / 5 - 0 ratings