内容简介:1.0 特性 纯打字稿生成,无需维护 graphql 文件 没有依赖关系 @notadd/cli a simple tool to generate graphql for @nestjs/graphql install npm i -g @notadd/cli use notadd graphql -i main.ts // ...
1.0 特性
- 纯打字稿生成,无需维护 graphql 文件
- 没有依赖关系
@notadd/cli
a simple tool to generate graphql for @nestjs/graphql
install
npm i -g @notadd/cli
use
notadd graphql
-i main.ts // input file default `main.ts`
-o notadd.graphql // output file default `notadd.graphql`
demo.ts and run notadd graphql
import { Resolver, Query } from "@nestjs/graphql";
export interface List<T> {
data: T[];
currentPage: number;
pageSize: number;
total: number;
}
export interface User {
username: string;
}
export interface Article {
title: string;
}
@Resolver()
export class DemoResolver {
@Query()
getUser(): List<User> {
return {} as any;
}
@Query()
getArticles(): List<Article> {
return {} as any;
}
}
type User {
username: String!
}
type UserList {
data: [User]!
currentPage: Int!
pageSize: Int!
total: Int!
}
type Article {
title: String!
}
type ArticleList {
data: [Article]!
currentPage: Int!
pageSize: Int!
total: Int!
}
type Query {
getUser: UserList!
getArticles: ArticleList!
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- 关于程序崩溃生成core文件的一些配置
- 工具 | 一个在线生成 nginx 配置文件的开源工具
- nginx在docker容器中自动生成配置文件
- 生成根证书CA及签发子证书及配置站点实践
- 京东猎户座发布开源,配置化一键生成 cms 系统
- 橙单中台化低代码生成器 v1.6 发布,可配置生成跨多库实时同步服务
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Software Engineering for Internet Applications
Eve Andersson、Philip Greenspun、Andrew Grumet / The MIT Press / 2006-03-06 / USD 35.00
After completing this self-contained course on server-based Internet applications software, students who start with only the knowledge of how to write and debug a computer program will have learned ho......一起来看看 《Software Engineering for Internet Applications》 这本书的介绍吧!