Type Safety
@graphql-ts/schema
provides type safety when defining your GraphQL schema
while avoiding the need for code generation, decorators, or other
complexity.
graphql-ts
Simple Type-Safe GraphQL Schemas in TypeScript
const Query = g.object()({ name: "Query", fields: { user: g.field({ type: User, args: { id: g.arg({ type: g.nonNull(g.ID) }), }, resolve(_, args, context) { return context.loadUser(args. );id }, }), },});
Type Safety
@graphql-ts/schema
provides type safety when defining your GraphQL schema
while avoiding the need for code generation, decorators, or other
complexity.
Direct Compatibility with GraphQL.js
Use @graphql-ts/schema
with any existing GraphQL server that uses
GraphQL.js, like GraphQL Yoga, Apollo Server, graphql-http, etc.