-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
楼主这个和prisma有什么不同,两个都不了解,求比较一下 #29
Comments
Prisma是一个ORM库,用于实现SQL语句的封装。 type Query {
posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post]!
users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]!
post(where: PostWhereUniqueInput!): Post
user(where: UserWhereUniqueInput!): User
postsConnection(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): PostConnection!
usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!
"""Fetches an object given its ID"""
node(
"""The ID of an object"""
id: ID!
): Node
} 增删改: type Mutation {
createPost(data: PostCreateInput!): Post!
createUser(data: UserCreateInput!): User!
updatePost(data: PostUpdateInput!, where: PostWhereUniqueInput!): Post
updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User
deletePost(where: PostWhereUniqueInput!): Post
deleteUser(where: UserWhereUniqueInput!): User
upsertPost(where: PostWhereUniqueInput!, create: PostCreateInput!, update: PostUpdateInput!): Post!
upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User!
updateManyPosts(data: PostUpdateInput!, where: PostWhereInput): BatchPayload!
updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!
deleteManyPosts(where: PostWhereInput): BatchPayload!
deleteManyUsers(where: UserWhereInput): BatchPayload!
} 更新: 而APIJSON是完全自动化生成SQL语句的,后端不需要写相关代码。 |
@zwl1619 APIJSON Node 版本也出来了,语言一样,你可以具体对比下。 apijson-node 支持单表、关联、数组、分页查询等,有比较完善的文档, 点 Star 鼓励作者继续完善吧 ^_^ |
楼主这个和prisma有什么不同,两个都不了解,求比较一下:
https://github.com/prismagraphql/prisma
The text was updated successfully, but these errors were encountered: