1. 程式人生 > >Takeaways From My First Adventure with GraphQL at GraphQL EU 2018

Takeaways From My First Adventure with GraphQL at GraphQL EU 2018

Two weeks ago, I had an opportunity to immerse myself in everything GraphQL at GraphQL Europe in Berlin. While there, I asked some of the attendees why they had decided to come. Most answered that they’d heard of GraphQL and were there to learn more: that they wanted to see if it was right for their company, that they wanted to hear about other people’s experiences with it, and that they wanted to see if it was something they could adopt. The rest were already sold on GraphQL.

The mix of motivations made sense. Since Facebook open-sourced GraphQL in 2015, it has surged in popularity. Reasons for this include its strongly typed schema, which acts a contract between the client and server, offering clear visibility into all of an API’s supported operations, and GraphQL’s efficient approach to API endpoint interactions that provide engineers with far greater control over their query requests. Thus, three years after its unveiling at React.js Conf 2015, GraphQL has been adopted by developers working across the stack. And this was evident all around the conference. “It’s very different from last year,” people told me in a variety of ways. “Last year’s conference was all about trying out GraphQL. This year, it’s the stories of GraphQL in production.”

As my background at DigitalOcean is in the infrastructure world and Linux, I was a bit nervous to jump into a such a development-focused event. However, I found my fears ungrounded. While the talks opened up many questions, many themes and ideas resonated with me, and I left the event excited.

My goal in this post, therefore, is to share some of my personal takeaways as well as to encourage others, especially those who might feel nervous about diving more deeply into GraphQL, to take a closer look.

There are three themes in the conference talks that I found encouraging:

“Yeah, well, you know, that’s just, like, your opinion, man”

Straight out of the gate, GraphQL Europe opened a debate. Offering a study in contrasts, the first and third talk of the conference took opposite approaches to the question of whether a repo and GraphQL code should be in a monolith or broken up into microservices. In the monolith corner, Nick Schrok, the co-creator of GraphQL, presented his view of tech development, saying, “Those who learn too much from history are doomed to overreact to it.” As applied to microservices (especially in the context of GraphQL), the worst possible scenario, he said, ends up being a “distributed monolith”. He highlighted Facebook’s architecture as an example of an effective monolith (although it still uses services).

On the other hand, Johannes Schickling, the CEO of Prisma, argued that the added complexity of the monolith and the challenges in updating the code make breaking it up into services and layers a useful exercise — and that GraphQL facilitates doing this effectively. The takeaway for me from this contrast was not so much that one approach is better than another, but that GraphQL supports a variety of architectures. In highlighting two opposite approaches, with GraphQL at their heart, the question of what GraphQL’s relation is to the monolith (vs microservices) is opened for further discussion in the future. The choice of the most appropriate architecture at this point, therefore, is left as an exercise for the reader.

For example….

As with anything new, rallying a community around it involves teaching and sharing information effectively with others. To this end, there were two presentations during the conference focused on GraphQL education, each with a distinct approach. In his talk, “Teaching GraphQL,” Daniel Woelfel, the co-founder of One Graph, shared his 5 principles for presenting GraphQL:

  1. Build concepts on top of each other
  2. Teach new concepts with motivated narratives
  3. Doing is understanding
  4. Make your students independent
  5. Entice their imagination with impressive demos

In a parallel approach, Jira Vinyoopongphan took on the real world challenge of “Making a Case for GraphQL: A recipe.” Among her ingredients and steps to cooking up company buy-in for GraphQL was the recommendation to highlight how GraphQL can address a pressing challenge being faced by a dev team.

Jira Vinyoopongphan presenting, “Making a Case for GraphQL: A recipe”

While these two talks seemed to orbit the challenge of sharing GraphQL knowledge differently, I found the overlap in offering specific examples striking. Being able to see how a new idea you’ve learned has a real application is incredibly powerful, and these two talks highlighted that precisely. There is something here for beginners to GraphQL and for those seeking to teach it. Unsure beginners can ease their way into GraphQL by asking practitioners for specific usage examples, both to make it concrete for themselves and also to guide the potential educators on the best angle to present it. Those already well versed in GraphQL can find an entry point for presenting it to others by choosing some interesting use cases to start off with, if they aren’t sure about how to approach the overall ecosystem.

“Make it work!”

In listening to the event talks, I was reminded that, although GraphQL’s capabilities are efficient and exciting, the technology is still young, growing in a mostly REST world. Nevertheless, the conference presentations actually demonstrated how this environment underscores GraphQL’s flexibility. They covered the real world situations that GraphQL users may find themselves in and touched on how they might play out for various companies. The overall pattern that emerged was that GraphQL has a high degree of adaptability in different existing tech architectures. There seemed to be a couple of possible states for GraphQL within a stack:

  • GraphQL native: GraphQL implemented and used in production exclusively, without REST
  • Migration from REST to GraphQL: A company going all in on GraphQL, with a goal of making the migration from REST as seamless as possible
  • GraphQL over REST: With REST entrenched in a codebase, such a setup is geared toward getting access to the most useful features of GraphQL without the heavy lift of a full scale migration

As a bonus, Nicholas Van Wiggeren (in “Fast, Slow, Beautiful, Ugly: Building GitHub’s Platform”) shared an interesting and very uncommon use case for GraphQL at Github, where REST was used over a GraphQL implementation. While this was unique to Github’s setup, it fit the pattern of the other talks: that engineers can make inroads with GraphQL with a broad array of approaches.

Leanne Shapton presenting “Scaling GraphQL at Shopify”

“That’s all, folks…”

My highlights are only the tip of the iceberg. In sharing them, I hope to illustrate that just as GraphQL can make a home within a company’s stack in a variety of ways, so too, can individuals find many approaches to playing around with it. With its usage still evolving, as beginners, we can see that there isn’t, yet, one right answer for how it can be used, that teaching GraphQL is a two-way street (that is, we should ask about what we want to learn, and teachers can use examples to help us understand), and that because every codebase is different, the role that GraphQL has in it can vary.

As a young open source project, GraphQL is learning from its community. The failures and successes you experience with it can feed straight back into its growth, whether to help people teach it better, to find interesting new ways to implement it, or to spark conversation (can we say debate?) about it overall. Dive in!

Bonus

There are a lot of great resources to get started with GraphQL. Here are some to check out:

相關推薦

Takeaways From My First Adventure with GraphQL at GraphQL EU 2018

Two weeks ago, I had an opportunity to immerse myself in everything GraphQL at GraphQL Europe in Berlin. While there, I asked some of the attendees why the

What I Learned from My First UX Internship at the Home Depot

To give a high-level summary, the most important things I learned include how to advocate for UX, how to work within the business context, the importance o

What I, as a College Senior, Learned from my Conversation with the CEO of Microsoft

On Wednesday, October 10th, I was afforded the opportunity to sit down with Microsoft CEO, Satya Nadella at the United States Naval Academy for a fireside

Lessons from My Math Degree That Have Nothing to Do with Math

Picture a mathematician. What do you see?I’ll conjure up a popular image. It’s late at night. A figure is hunched over a desk scribbling into a notebook. T

How I unlocked $750/month of revenue from my app with a single decision

How I unlocked $750/month of revenue from my app with a single decisionA post for those who care about how apps are priced, and how people behave when face

[Machine Learning with Python] My First Data Preprocessing Pipeline with Titanic Dataset

The Dataset was acquired from https://www.kaggle.com/c/titanic For data preprocessing, I firstly defined three transformers: DataFrameSelector: S

My first Graphics project

cat open cin imp tracer eal more end real-time   Rasterizer VS Raytracer   Rasterizer:   1, real-time rendering, hard mode for optimizati

Python--my first try!

you 會有 == cal col call != while hat 我所用的編譯器是:Python 3.6.0 我之所以在一開始就說我的編譯器是因為不同的編譯器,不同的版本在代碼的寫法上會有一些區別! 比如:在我所用的版本3中print的用法是Print (“hello

question 002: dev c++ 當中如何調整字體大小?How to get the first program with C++? c++屬於什麽軟件?

space 什麽 pil get ctrl+鼠標 iostream 系統 using clu 方法:按住ctrl+鼠標滑輪滾動 c++屬於系統軟件還是應用軟件? 說哪個都不對,編譯之前屬於應用軟件,after compile ,it belongs to system so

my first blog

pri 自己 pau 今天 clu 測試 pause style 。。 大一就打算弄過blog,那時候覺得沒什麽好寫的就沒有弄。後來又在自搭服務器和CSDN或者博客園中徘徊,一拖拖了好幾年,今天終於決定用博客園了。 畢竟,自己建的服務器,誰也不知道啥時候就域名沒了,或者服務

this is my first

rem ctu lac oct item ros isa targe del this is my first or <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" layout:dec

LeetCode題862 —— Shortest Subarray with Sum at Least K

date 重新 滑動窗口 nbsp sub etl gen index min Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K. If th

My first blog!

總結 產生 和我 有道 記錄 first 不定 經驗 文件 我與博客的那些事 說到寫博客這件事情從老來都和我不著邊的東西,為什麽突然會萌發出寫博客這樣瘋狂的事情?在我看來寫博客感覺是個高端人才或者是那些技術大牛展示的平臺。給我這種感受是因為在此之前有啥技術問題不會的就會去找

My first program and first blogs-三級菜單

logs spa items pan choice dmi als ase rst _author Administrator#date 2018/9/7items = { ‘陜西‘:{ ‘西安‘:[‘周至‘,‘戶縣‘,‘

My First Spring-Boot Project(2)

自動 pro 文件夾 昨天 ima wid bubuko gradle boot 英文學不好,今天用中文描述。 看回昨天新建的工程。 點擊下一步應該選擇Gradle Project,這樣就會自動生成必須的文件夾及啟動文件 SpringBootApplication 和

My First Spring-Boot Project(1)

gem end asp see f429 str show ttl one First of all, open the IDE -----> IDEA click File ->New Project Choose the basic spring-bo

My First Blogs

First Try 1.試探性發一篇 Linux的有趣小外掛 a.火焰動態效果 b.圖形字元 1.試探性發一篇 Linux的有趣小外掛 以下小外掛均需要安裝,在Linux控制檯直接

First Contaction with Data Image Processing and Some Social Problems That This Technology Can Solve

In the class I had in last term, I first contacted the data image processing. Images in the computer can be roughly divided into binary images, gr

my first boke

TextView使用技術點(一) TextView使用技術點(一) 2017年04月18日 11:46:11 GJianAJ 閱讀數:5452 標籤: TextView 文字 Android View 更多 個人分類: Android開發收穫 所屬專欄

Extract public key ASN.1 encode from X.509 certificate with OpenSSL

    X509_get0_pubkey_bitstr( ) function is declared in x509.h of OpenSSL source code set. Let's have a look at it: ASN1_BIT_STRING *X509_g