TypeGraphQL
约 1 分钟阅读
标签:TypeScript
- MichalLytek/type-graphqlGitHubMichalLytek/type-graphqlMichalLytek/type-graphql · MIT, Typescript · 注解/修饰器 方式 · 文件上传 #37 · relay · 需要自己实现 · https://github.com/calmonr/typegraphql-relay笔记:TypeGraphQL
- MIT, Typescript
- 注解/修饰器 方式
- 文件上传 #37GitHub IssueMichalLytek/type-graphql#37
- relay
- 需要自己实现
- calmonr/typegraphql-relayGitHubcalmonr/typegraphql-relay
- 不能 @Public 只能 @Authorized
- Inverted authorization mode #230GitHub IssueMichalLytek/type-graphql#230
- Data loader integration #51GitHub IssueMichalLytek/type-graphql#51
- 可以依赖底层的 ORM 去做
- 例如 MikroORM 支持 dataloader
- Directive
- #77GitHub IssueMichalLytek/type-graphql#77
@Directive('@deprecated(reason: "Use newField")')
Notes
- @Args()
- @ArgsType()
- @Authorized()
- @Ctx()
- @EnumType()
- @Field()
- @FieldResolver()
- @Info()
- @InputType()
- @InterfaceType()
- @Mutation()
- @ObjectType()
- @PubSub()
- @Query()
- @Resolver()
- @Root()
- @Subscription()
- @UseMiddleware()
- @ValidateArgs()
Internal
- getMetadataStorage
// 全局注册中心
import { getMetadataStorage } from 'type-graphql';
// @InputType() 等同于
getMetadataStorage().collectInputMetadata({
name: name || target.name,
target,
description: options.description,
});
// 等同于记录定义 - 等到调用 build 的时候才开始正式处理
MetadataStorage.inputTypes.push(definition)关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- GraphQL Awesome笔记 · MichalLytek/type-graphql
WebUI · graphql/graphiql · graphql/graphql-playground · https://www.graphqlbin.com/v2/new · graphql-kit/graphql-voyager · interactive graph
References
GitHub6 条
- calmonr/typegraphql-relaygithub.com/calmonr/typegraphql-relay
- MichalLytek/type-graphqlgithub.com/MichalLytek/type-graphql
- MichalLytek/type-graphql#230github.com/MichalLytek/type-graphql/issues/230
- MichalLytek/type-graphql#37github.com/MichalLytek/type-graphql/issues/37
- MichalLytek/type-graphql#51github.com/MichalLytek/type-graphql/issues/51
- MichalLytek/type-graphql#77github.com/MichalLytek/type-graphql/issues/77