【文件属性】:
文件名称:graphql-clj:一个提供GraphQL实现的Clojure库
文件大小:188KB
文件格式:ZIP
更新时间:2021-02-01 08:13:35
graphql clojure clojure-library graphql-server clj
图ql-clj
Clojure库旨在提供GraphQL实现。
演示版
0.2版中的新功能
简化的API
重写模式和查询验证器以简化和增强功能。
用于模式和查询的单独的解析器和验证器。
高性能Java解析器
安装
将以下依赖项添加到project.clj文件:
[graphql-clj "0.2.9"]
用法
定义架构
( def schema-str " type User {
name: String
age: Int
}
type QueryRoot {
user: User
}
schema {
query: QueryRoot
} " )
定义解析器功能
( defn resolver-fn [type-name field-name]
( get-in { " QueryRoot " { " user " ( fn [context parent args]
{ :name " test user name "