@@ -16,6 +16,7 @@ In addition to the GraphQL [reference implementations in JavaScript](#javascript
16
16
- [ Erlang] ( #erlang )
17
17
- [ Go] ( #go )
18
18
- [ Groovy] ( #groovy )
19
+ - [ Haskell] ( #haskell )
19
20
- [ Java] ( #java )
20
21
- [ JavaScript] ( #javascript )
21
22
- [ Julia] ( #julia )
@@ -170,6 +171,74 @@ See [the documentation](https://grails.github.io/gorm-graphql/latest/guide/index
170
171
171
172
GQL is a Groovy library for GraphQL
172
173
174
+ ### Haskell
175
+
176
+ #### [ Morpheus GraphQL] ( https://github.com/morpheusgraphql/morpheus-graphql )
177
+
178
+ A Haskell library for building GraphQL APIs.
179
+
180
+ Hello world example with ` morpheus-graphql ` :
181
+
182
+ ``` graphql
183
+ # schema.gql
184
+ """
185
+ A supernatural being considered divine and sacred
186
+ """
187
+ type Deity {
188
+ name : String !
189
+ power : String @deprecated (reason : " no more supported" )
190
+ }
191
+
192
+ type Query {
193
+ deity (name : String ! = " Morpheus" ): Deity !
194
+ }
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
+
210
+ module API (api) where
211
+
212
+ import Data .ByteString .Lazy .Char8 (ByteString)
213
+ import Data .Morpheus (interpreter)
214
+ import Data .Morpheus .Document (importGQLDocument)
215
+ import Data .Morpheus .Types (RootResolver (..), Undefined (..))
216
+ import Data .Text (Text)
217
+
218
+ importGQLDocument "schema.gql"
219
+
220
+ rootResolver :: RootResolver IO () Query Undefined Undefined
221
+ rootResolver =
222
+ RootResolver
223
+ { queryResolver = Query {deity },
224
+ mutationResolver = Undefined ,
225
+ subscriptionResolver = Undefined
226
+ }
227
+ where
228
+ deity DeityArgs {name } =
229
+ pure
230
+ Deity
231
+ { name = pure name ,
232
+ power = pure (Just "Shapeshifting" )
233
+ }
234
+
235
+ api :: ByteString -> IO ByteString
236
+ api = interpreter rootResolver
237
+ ```
238
+
239
+ See [morpheus -graphql -examples ](https ://github .com /morpheusgraphql /morpheus -graphql ) for more sophisticated APIs .
240
+
241
+
173
242
### Java
174
243
175
244
#### [graphql-java](https://github.com/graphql-java/graphql-java)
@@ -598,6 +667,7 @@ Executor.execute(schema, query) map println
598
667
- [Elm](#elm)
599
668
- [Flutter](#flutter)
600
669
- [Go](#go-1)
670
+ - [Haskell](#haskell)
601
671
- [Java / Android](#java-android)
602
672
- [JavaScript](#javascript-1)
603
673
- [Julia](#julia)
@@ -634,6 +704,10 @@ Executor.execute(schema, query) map println
634
704
- [graphql ](https ://github .com /shurcooL /graphql #readme): A GraphQL client implementation in Go.
635
705
- [machinebox /graphql ](https ://github .com /machinebox /graphql ): An elegant low -level HTTP client for GraphQL .
636
706
707
+ ### Haskell
708
+
709
+ - [morpheus -graphql -client ](https ://github .com /morpheusgraphql /morpheus -graphql ): A strongly -typed GraphQL client implementation in Haksell .
710
+
637
711
### Java / Android
638
712
639
713
- [Apollo Android ](https ://github .com /apollographql /apollo -android ): A strongly -typed , caching GraphQL client for the JVM , Android and Kotlin native .
0 commit comments