apiql
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

apiql

对graphql的语法扩展,在graphql的语法基础上增加了 继承和泛型,语法基本和graphql保持一致,有部分修改

继承示例

type UserBaseInfo{
	id:ID!
	name:String!
	gender:String!
}

type Administrator extends UserBaseInfo{
	number:String!
	password:String
}

泛型示例

type Paged<T> {
	count:Int!
	pageSize:Int!
	page:Int!
	datas:[T!]
}

type Query{
	users(page:Int!, pageSize:Int!): Paged<User>
	movies(page:Int!, pageSize:Int!): Paged<Movie>
}

查询简化

# 类型可以忽略
query getUsers($page){
   #同名的可以不用写名称
   users(page, pageSize:20){
      count
      datas{
         id
         name
      }
   }
}

/apiql/

    Package Sidebar

    Install

    npm i apiql

    Weekly Downloads

    3

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    130 kB

    Total Files

    63

    Last publish

    Collaborators

    • yizhi