1. 程式人生 > >GraphQL Europe 2018 - A summary

GraphQL Europe 2018 - A summary

Schema design is important

GraphQL is a relatively newtechnology, and lots of the time we spent with it was trying to get into the right mindset. It’s really cool, then, to see the amount of best practices that are emerging from various sources. Leanne Shapton spent a fantastic 20 minutes going through the

lessons that the Shopify team have learnt since adopting GraphQL. We could have avoided a lot of growing pains had we heard her a year ago! Specifically, her advice around paginating early, grouping related fields together and pushing complex calculations up to the server all really resonated with us.

There was a similar theme in Nicholas Van Wiggeren’s talk about adoption of GraphQL within GitHub — establishing best practices as early as possible made it much easier for them to get traction within the organisation, and remove the inevitable friction of a new technology as much as possible.

It was great to hear about some of the GitHub internals as well — the fact that their REST v3 API is now powered by GraphQL is a really cool inversion of the normal pattern you see with REST and GraphQL!

Type safety is pretty cool

The idea of type safety has always been a big part of GraphQL for me. The fact you get a strongly-typed contract between server and client is a core feature, and embedding that contract in the transport layer is a big part of what makes GraphQL such a game-changer.

However, I hadn’t realised what a big draw type safety was for a lot of people. Tyler Martinez and Johannes Schickling both about the idea of end-to-end type safety, with Scala or OCaml on the backend, TypeScript or Swift on the frontend, and GraphQL providing type safety at all levels. Tools like apollo-codegen can even translate between your schema definition and your types, giving you even more confidence in your code.

This idea really resonated with me, and it’s driven me to explore ideas like TypeScript (and apollo-codegen) much more in the future.

GraphQL architectures are varied

Quite a few speakers went into detail about their GraphQL architecture, and the different patterns that have started to emerge around how to build GraphQL systems.

The fact that we had two speakers, almost back to back, both advocating monoliths and talking about breaking them up, shows the variety and diversity of thought in this area.

Microservices

Lots of people are using GraphQL as a layer on top of their microservices. This has allowed them to slowly sub out some of the more painful parts of the infrastructure. As put by one of the speakers — if part of your estate is dying, GraphQL allows you to hide the bodies.

Sasha Solomon went into detail about the architecture that now powers Medium, and how it allowed them to migrate to a new client without slowing down product development. Medium has split their server architecture into three types of components — Schema, Fetchers, and Repositories. Fetchers provide a pure data fetching layer, pulling data from Medium’s existing business services over REST or gRPC, using Protobuffs. Repositories call out to Fetchers, and shape the data correctly for the Schema, which is derived from the Repositories. It looked like a really great pattern to adopt a GraphQL layer in front of your existing services.

Monoliths

Nick Schrock spoke a lot about monoliths, and how he sees the current move towards microservices as an overcorrection to some of the pain of traditional monoliths. The idea that microservices are a tool, rather than a goal, was received very warmly

One of the reasons people like GraphQL is because they miss the good parts of a monolith.

He also spoke about the idea of a GraphQL-Native application. He described GraphQL-Native as an integrated, cohesive, and flexible architecture, with a fat gateway between clients and services, that provides a source of truth for clients. Logic sits within the gateway, which calls out to capability-based services.

There were also some really interesting unconventional uses of the GraphQL Schema Definition Language (SDL), and both Arnaud Rinquin and Stephen Wan talked about their journey in getting more dynamic interactions with GraphQL servers, through the use of both subscriptions and Live Queries.

Diverse Languages

GraphQL has a reputation of being a front-end technology, and specifically associated with JavaScript. Lee Byron spoke about this being a consequence of how, and more importantly, where, GraphQL was announced — at a React conference.

However, I was really struck by the sheer diversity of languages and technology that was in use by speakers and attendees at the conference. I spoke to people using JavaScript, Scala, OCaml, Ruby, and even a team that had production services in Lua! There was also a great, whirlwind talk by Sara Viera about using GraphQL with Vue instead of React.

I think it’s one of the great strengths of GraphQL as a community, that it brings many disparate communities together to talk about how to build better products and services.

We should be investing in Tools

The GraphQL community has built some amazing tooling, and that trend looks to continue!

  • The Prisma team announced a new GraphQL plugin for VSCode, which comes with full GraphQL syntax support, query autocompletion and schema validation.
  • Peggy Rayzis announced a new release candidate of apollo-server-2.0 during her talk — this includes features such as subscriptions, error handling tools, schema stitching, and schema directives. It also supports Apollo-Engine as standard, and can run on a CDN edge via Cloudflare Workers!

However, Lee highlighted that tooling still isn’t in the place he anticipated when first putting his GraphQL secret master plan together.

A couple of people called out the need for a “Rails for GraphQL”, and the wish for more vertically integrated toolkits. Getting started with a client & server is still a bit awkward, so a more opinionated tool which can effectively scaffold a new application would be an awesome addition to the ecosystem.

Lots of successful GraphQL adoption

It was brilliant to see how many organisations had adopted GraphQL over the past year. There were lots of stories of successful migrations, both in a technical and organisational sense.

I particularly enjoyed Jira Vinyoopongphan’s talk about how to go about getting GraphQL adopted in your organisation — how to engage interested parties with inspiring demos, and the importance of making yourself available to support adoption.

Most successful adoption stories seemed to follow a similar pattern: one of incremental adoption. Rather than a full migration program, GraphQL allowed teams to add a gateway to their architecture, and then slowly substitute the services which backed that gateway with improved or new versions. This has been possible before, but the expressiveness and freedom that GraphQL provides with resolvers has made this seemingly a much nicer experience.

相關推薦

GraphQL Europe 2018 - A summary

Schema design is importantGraphQL is a relatively newtechnology, and lots of the time we spent with it was trying to get into the right mindset. It’s reall

Watch all talks from GraphQL Europe 2018

Watch all talks from GraphQL Europe 2018

Avito Code Challenge 2018 A~E

ID 情況 elves In shel int 長度 %d -o A. Antipalindrome 還以為是什麽神dp結果就是分情況討論啊 原串是一串一樣的字符的話輸出0,是回文串的話輸出n-1,否則直接輸出原串長度 #include<iostream> #i

PKU campus 2018 A Wife——差分約束?/dp

fine define stream esp pre lld efi 方案 之前 題目:http://poj.openjudge.cn/campus2018/A 有正規的差分約束做法,用到矩陣轉置等等。 但也有簡單(?)的dp做法。   有一個結論(?):一定要麽在一天一點

German Collegiate Programming Contest 2018? A. Attack on Alpha-Zet

順序 技術分享 a-z contest 路徑 print bfs class roo 題目鏈接https://nanti.jisuanke.com/t/28852 題目大意是 h*w 的平面,每兩個點有且僅有一條路徑,類似於封閉的聯通空間,然後在這h*w個點中選取(標記

2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018) A. Altruistic Amphibians DP

題目連結:https://codeforc.es/gym/101933/problem/A 題意:有 n 只青蛙在一個坑裡面,要求可以跳出坑的青蛙的最大數量。每個青蛙有 3 種屬性:l 為青蛙一次可以跳的高度,w 為青蛙的重量,h 為青蛙作為墊背時的高度,墊背的前提是墊背的青蛙的重量比在他上面的青蛙的總重量

數模2018-A

預熱 賽題下載:百度網盤 溫度分佈是指在給定時間的空間某區域內溫度隨空間位置的變化。這是熱量傳遞中要解決的主要問題。在換熱器、反應器等化工裝置中,由於兩流體存在溫差,或因反應具有熱效應,因而形成溫度分佈。熱量僅以熱傳導方式傳遞時,溫度分佈可有熱傳導方程解出,通常採用數值解方法。熱量以對流傳熱方式傳遞時,若

Avito Cool Challenge 2018 A. Definite Game(CF1081A)

題目:Definite Game 題意: 給出一個正整數n,可以多次操作,每次操作可以把n減去一個和n互質的數。 問n的最小可能值。 思路: 大於2的數都直接輸出1就好,因為可以直接減去n-1,n-1和n一定是互質的。 2的話輸出2,1輸出1。

Avito Cool Challenge 2018 A. B題解

A. Definite Game 題目連結:https://codeforces.com/contest/1081/problem/A 題意: 給出一個數v,然後讓你可以重複多次減去一個數d,滿足v%d!=0,問最後可以得到最小的是多少。   題解: 除開v=2輸出2,其餘直接輸出1就行

Avito Cool Challenge 2018 A. Definite Game(水題)

題目連結:http://codeforces.com/contest/1081/problem/A 題意:給出一個正整數n,可以多次操作,每次操作可以把n減去一個和n互質的數。問n的最小可能值(最小為1)。 思路:大於2的數都直接輸出1就好,因為可以直接減去n-1,n-1和n一定是互質的

A Summary of Multi-task Learning

A Summary of Multi-task Learning author by Yubo Feng. Intro In this paper[0], the introduction of multi-task learning through the data hungry, the most

Token Fest 2018a personal gist

Token Fest 2018 — a personal gistI knew about Bitcoin quite a while ago but got really interested in the Blockchain technology when the 2013/14 peak was th

Out of Office Hours: A summary of my experience.

Above and BeyondThere were a handful of folks that I talked to who were developers and were having issues getting past the code challenges that most compan

Good Bye 2018 A. New Year and the Christmas Ornament

傳送門 https://www.cnblogs.com/violet-acmer/p/10201535.html   題解:   這題沒什麼好說的,讀懂題意就會了。 比賽程式碼: 1 #include<iostream> 2 using namespac

codeforces Good Bye 2018 A,B,C題解

A. New Year and the Christmas Ornament 題目: 傳送門A 思路: (1)此題當時沒想分類討論,直接列舉第一個數暴力出來的。 程式碼如下:   #include <bits/stdc++.h> using namesp

Avito Cool Challenge 2018 A. Definite Game

Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some sma

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

CF hello 2018(A~E)

點此開啟 A 程式碼示例 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdi

2018年全國多校算法寒假訓練營練習比賽(第二場)A.吐泡泡

兩種 mark 例如 mes names urn mar code else 原題鏈接 描述 小魚兒吐泡泡,嘟嘟嘟冒出來。小魚兒會吐出兩種泡泡:大泡泡"O",小泡泡"o"。 兩個相鄰的小泡泡會融成一個大泡泡,兩個相鄰的大泡泡會爆掉。 (是的你沒看錯,小氣泡和大氣泡不會產生任

斯特林公式-Stirling公式(取N階乘近似值)-HDU1018-Big Number 牛客網NowCoder 2018年全國多校算法寒假訓練營練習比賽(第三場)A.不凡的夫夫

subject color content coder -m ria 一點 練習 java 最近一堆題目要補,一直鹹魚,補了一堆水題都沒必要寫題解。備忘一下這個公式。 Stirling公式的意義在於:當n足夠大時,n!計算起來十分困難,雖然有很多關於n!的等式,但並不能很