![]() So let’s try to understand the how and why underlying the creation of GraphQL connections. Most people who have been around GraphQL for a while understand what a connection is, but we want to take a more critical look. An example of a connection from the SWAPI example GraphQL API. They were first introduced into the open source ecosystem by the “ Relay Cursor Connections Specification.” The way GraphQL connections were announced made it seem like an aspect of a specific data fetching library, but it’s something all GraphQL developers can get value from.įacebook coined the term “connection” in the GraphQL context, but it’s really nothing more than a new name for the cursor-based pagination model that has been in use for a long time. To learn more about pagination, make sure to read this excellent post by Sashko Stubailo: “ Understanding pagination: REST, GraphQL, and Relay.” Where did connections come from?Ĭonnections were designed at Facebook as part of their internal GraphQL server design. Note: This post assumes some level of knowledge about the mechanics of cursor-based pagination. What should you keep in mind when using connections?.However, connections are not specific to Relay at all, and this post will hopefully help clear up this common misconception.Ĭonnections can be hard to understand because they use opaque vocabulary like “cursor,” “connection,” and “edge.” So in this post I will explain the terminology and try to answer three important questions about GraphQL connections: These are often associated with Relay, a JavaScript GraphQL client open sourced by Facebook. The most popular method for pagination in GraphQL are GraphQL connections. By paginating our data set we are choosing a strategy to provide data in separate, small, “pages” which are digestible by both our users and our applications. Sometimes, it’s not even possible process the entire data set at once. It’s the same with GraphQL: If APIs returned one continuous list of data then our applications would suffer major performance penalties. An audiobook just flows continuously at one constant rate which makes it difficult to jump back or skip parts. Pages exist in books to help people find stuff in a large collection of words, and pages help create clear boundaries between ideas. Yet there is one thing that I find difficult about the medium. ![]() ![]() I’m pretty happy now with my new found hobby that allows me to take a book anywhere and “read” while doing tasks where my eyes would otherwise be occupied. Thanks to the incessant work of the Audible marketing team Amazon has converted me into an audiobook consumer. I don’t read many books these days, but I do listen to books. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |