在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):hayes/pothos开源软件地址(OpenSource Url):https://github.com/hayes/pothos开源编程语言(OpenSource Language):TypeScript 98.8%开源软件介绍(OpenSource Introduction):Pothos GraphQLPothos is a plugin based GraphQL schema builder for typescript. It makes building graphql schemas in typescript easy, fast and enjoyable. The core of Pothos adds 0
overhead at runtime, and has Pothos is the most type-safe way to build GraphQL schemas in typescript, and by leveraging type inference and typescript's powerful type system Pothos requires very few manual type definitions and no code generation. Pothos has a unique and powerful plugin system that makes every plugin feel like its features are built into the core library. Plugins can extend almost any part of the API by adding new options or methods that can take full advantage of the Pothos type system. Hello, Worldimport { createServer } from '@graphql-yoga/node';
import SchemaBuilder from '@pothos/core';
const builder = new SchemaBuilder({});
builder.queryType({
fields: (t) => ({
hello: t.string({
args: {
name: t.arg.string(),
},
resolve: (parent, { name }) => `hello, ${name || 'World'}`,
}),
}),
});
const server = createServer({
schema: builder.toSchema({}),
});
server.start(); What sets Pothos apart
Plugins that make Pothos even better
SponsorsPothos development supported by sponsorships from these generous people and organizations: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论