项目
在 GitHub 查看
stepci/garph
关于
适用于 TypeScript 的全栈 GraphQL 框架
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- -2
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文garph
Warning: We would love to hear your Feedback in our Discord
Note: tRPC-style client for Garph has arrived! See garph-gqty for more 🚀
Garph is a fullstack GraphQL framework for TypeScript, that aims to deliver the best GraphQL Developer-Experience.
Get started
Install the dependencies
npm i garph graphql-yogaCreate example GraphQL API
import { g, InferResolvers, buildSchema } from 'garph' import { createYoga } from 'graphql-yoga' import { createServer } from 'http' const queryType = g.type('Query', { greet: g.string() .args({ name: g.string().optional().default('Max') }) .description('Greets a person') }) const resolvers: InferResolvers<{ Query: typeof queryType }, {}> = { Query: { greet: (parent, args, context, info) => `Hello, ${args.name}` } } const schema = buildSchema({ g, resolvers }) const yoga = createYoga({ schema }) const server = createServer(yoga) server.listen(4000, () => { console.info('Server is running on http://localhost:4000/graphql') })Start the server
npx ts-node server.tsQuery the API
Go to: http://localhost:4000/graphl
Enter the following query:
{ greet(name: "Max") }Click on the play button
Documentation
Documentation is available on garph.dev/docs
Examples
Example projects can be found under examples/
Feedback
We would love to hear your Feedback in our Discord community
探索相关项目
加载中…