@@ -12,10 +12,12 @@ GraphQL 已有多种编程语言支持。下表包含一些流行的服务端框
12
12
13
13
- [ C# / .NET] ( #c-net )
14
14
- [ Clojure] ( #clojure )
15
+ - [ D] ( #d )
15
16
- [ Elixir] ( #elixir )
16
17
- [ Erlang] ( #erlang )
17
18
- [ Go] ( #go )
18
19
- [ Groovy] ( #groovy )
20
+ - [ Haskell] ( #haskell )
19
21
- [ Java] ( #java )
20
22
- [ JavaScript] ( #javascript )
21
23
- [ Kotlin] ( #kotlin )
@@ -60,6 +62,7 @@ public class Program
60
62
- [ Entity GraphQL] ( https://github.com/lukemurray/EntityGraphQL ) :针对 .NET Core 的 GraphQL 库。编译为 IQueryable 以轻松地从现有的数据模型(例如从 Entity Framework 数据模型)中暴露出 schema
61
63
- [ DotNetGraphQLQueryGen] ( https://github.com/lukemurray/DotNetGraphQLQueryGen ) :从 GraphQL schema 生成类,以在 dotnet 中进行类型安全的查询的 .NET Core 库
62
64
- [ Hot Chocolate] ( https://github.com/ChilliCream/hotchocolate ) :针对 .NET core 和 .NET classic 的 GraphQL 服务器
65
+ - [ NGraphQL] ( https://github.com/rivantsov/starwars ) :用于 .NET Core 和完整框架的 GraphQL 服务器
63
66
64
67
### Clojure
65
68
@@ -128,6 +131,10 @@ $ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
128
131
129
132
一套 GraphQL 规范的完整实现,致力于维护对规范的外部兼容。
130
133
134
+ ### D
135
+
136
+ - [ graphqld] ( https://github.com/burner/graphqld ) :D 编程语言的 GraphQL 实现。
137
+
131
138
### Elixir
132
139
133
140
- [ absinthe] ( https://github.com/absinthe-graphql/absinthe ) :Elixir 的 GraphQL 实现。
@@ -165,6 +172,66 @@ $ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
165
172
#### [ GQL] ( https://grooviter.github.io/gql/ )
166
173
167
174
GQL 是一个在 Groovy 中使用 GraphQL 的库。
175
+
176
+ ### Haskell
177
+
178
+ #### [ Morpheus GraphQL] ( https://github.com/morpheusgraphql/morpheus-graphql )
179
+
180
+ 用于构建 GraphQL API 的 Haskell 库。
181
+
182
+ 一个使用 ` morpheus-graphql ` 的 hello world 示例:
183
+
184
+ ``` graphql
185
+ # schema.gql
186
+ """
187
+ A supernatural being considered divine and sacred
188
+ """
189
+ type Deity {
190
+ name : String !
191
+ power : String @deprecated (reason : " no more supported" )
192
+ }
193
+ type Query {
194
+ deity (name : String ! = " Morpheus" ): Deity !
195
+ }
196
+ ```
197
+
198
+ ```haskell
199
+ {-# LANGUAGE DeriveGeneric #-}
200
+ {-# LANGUAGE DuplicateRecordFields #-}
201
+ {-# LANGUAGE FlexibleContexts #-}
202
+ {-# LANGUAGE FlexibleInstances #-}
203
+ {-# LANGUAGE MultiParamTypeClasses #-}
204
+ {-# LANGUAGE NamedFieldPuns #-}
205
+ {-# LANGUAGE OverloadedStrings #-}
206
+ {-# LANGUAGE ScopedTypeVariables #-}
207
+ {-# LANGUAGE TemplateHaskell #-}
208
+ {-# LANGUAGE TypeFamilies #-}
209
+ module API (api) where
210
+ import Data .ByteString .Lazy .Char8 (ByteString)
211
+ import Data .Morpheus (interpreter)
212
+ import Data .Morpheus .Document (importGQLDocument)
213
+ import Data .Morpheus .Types (RootResolver (..), Undefined (..))
214
+ import Data .Text (Text)
215
+ importGQLDocument "schema.gql"
216
+ rootResolver :: RootResolver IO () Query Undefined Undefined
217
+ rootResolver =
218
+ RootResolver
219
+ { queryResolver = Query {deity },
220
+ mutationResolver = Undefined ,
221
+ subscriptionResolver = Undefined
222
+ }
223
+ where
224
+ deity DeityArgs {name } =
225
+ pure
226
+ Deity
227
+ { name = pure name ,
228
+ power = pure (Just "Shapeshifting" )
229
+ }
230
+ api :: ByteString -> IO ByteString
231
+ api = interpreter rootResolver
232
+ ```
233
+
234
+ 查看 [morpheus -graphql -examples ](https ://github .com /morpheusgraphql /morpheus -graphql ) 了解更复杂的 API 。
168
235
169
236
### Java
170
237
@@ -316,6 +383,7 @@ Apollo Server 也支持所有的 Node.js HTTP 服务器框架:Express、Connec
316
383
### Kotlin
317
384
318
385
- [graphql -kotlin ](https ://github .com /ExpediaGroup /graphql -kotlin /):一组用于在 Kotlin 中运行 GraphQL 服务器的库。
386
+ - [KGraphQL ](https ://github .com /aPureBase /KGraphQL ):设置 GraphQL 服务器的一个纯 Kotlin 实现。
319
387
320
388
### Perl
321
389
@@ -333,6 +401,8 @@ Apollo Server 也支持所有的 Node.js HTTP 服务器框架:Express、Connec
333
401
- [Lighthouse ](https ://github .com /nuwave /lighthouse ):一个用于 Laravel 的 GraphQL 服务器
334
402
- [GraphQLBundle ](https ://github .com /overblog /GraphQLBundle ):一个用于 Symfony 的 GraphQL 服务器
335
403
- [WPGraphQL ](https ://github .com /wp -graphql /wp -graphql ):一个免费的开源 WordPress 插件,可为任何 WordPress 网站提供可扩展的 GraphQL schema 和 API
404
+ - [GraphQL API for WordPress ](https ://github .com /GraphQLAPI /graphql -api -for -wp ):WordPress 的 GraphQL 服务器
405
+ - [GraPHPinator ](https ://github .com /infinityloop -dev /graphpinator ):现代 PHP 的一个 GraphQL 实现
336
406
337
407
#### [API Platform](https://api-platform.com) ([github](https://github.com/api-platform/api-platform))
338
408
@@ -586,9 +656,11 @@ Executor.execute(schema, query) map println
586
656
587
657
- [C # / .NET](#c-net-1)
588
658
- [Clojurescript ](#clojurescript-1)
659
+ - [Elixir](#elixir-1)
589
660
- [Elm](#elm)
590
661
- [Flutter](#flutter)
591
662
- [Go](#go-1)
663
+ - [Haskell](#haskell-1)
592
664
- [Java / Android](#java-android)
593
665
- [JavaScript](#javascript-1)
594
666
- [Julia](#julia)
@@ -607,6 +679,11 @@ Executor.execute(schema, query) map println
607
679
608
680
- [re -graph ](https ://github .com /oliyh /re -graph /):一个在 Clojurescript 中实现的 GraphQL 客户端,支持 websockets 。
609
681
682
+ ### Elixir
683
+
684
+ - [Neuron ](https ://github .com /uesteibar /neuron ):Elixir 的 GraphQL 客户端
685
+ - [common_graphql_client ](https ://github .com /annkissam /common_graphql_client ):支持 HTTP 和 WebSocket 的 Elixir GraphQL 客户端
686
+
610
687
### Elm
611
688
612
689
- [dillonkearns /elm -graphql ](https ://github .com /dillonkearns /elm -graphql ):一个库和命令行代码生成器,用于为 GraphQL 入口端点创建类型安全的 Elm 代码。
@@ -620,6 +697,10 @@ Executor.execute(schema, query) map println
620
697
- [graphql ](https ://github .com /shurcooL /graphql #readme):一个使用 Go 编写的 GraphQL 客户端实现。
621
698
- [machinebox /graphql ](https ://github .com /machinebox /graphql ):用于 GraphQL 的一个优雅的底层 HTTP 客户端。
622
699
700
+ ### Haskell
701
+
702
+ - [morpheus -graphql -client ](https ://github .com /morpheusgraphql /morpheus -graphql ):使用 Haskell 的一个强类型 GraphQL 客户端实现。
703
+
623
704
### Java / Android
624
705
625
706
- [Apollo Android ](https ://github .com /apollographql /apollo -android ):一个用于 JVM 、Android 和 Kotlin native 的 GraphQL 客户端,强类型、带缓存功能。
0 commit comments