File tree 1 file changed +28
-0
lines changed 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,34 @@ public class HelloWorld {
262
262
263
263
See [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.
264
264
265
+ ### Clojure
266
+
267
+ #### [graphql-clj](https://github.com/tendant/graphql-clj)
268
+
269
+ A Clojure library designed to provide GraphQL implementation.
270
+
271
+ Code that executes a hello world GraphQL query with \`graphql-clj\`:
272
+
273
+ \`\`\`clojure
274
+ (require '[graphql-clj.parser :as parser])
275
+ (require '[graphql-clj.type :as type])
276
+
277
+ (def parsed-schema (parser/parse "type Query {
278
+ hello: String
279
+ }"))
280
+
281
+ (def type-schema (type/create-schema parsed-schema))
282
+
283
+ (defn resolver-fn [type-name field-name]
284
+ (cond
285
+ (and (= "Query" type-name) (= "hello" field-name)) (fn [context parent & rest]
286
+ "Hello world!")))
287
+
288
+ (require '[graphql-clj.executor :as executor])
289
+
290
+ (executor/execute nil type-schema resolver-fn "{ hello }")
291
+ \`\`\`
292
+
265
293
### Go
266
294
267
295
- [graphql-go](https://github.com/graphql-go/graphql): An implementation of GraphQL for Go / Golang.
You can’t perform that action at this time.
0 commit comments