Skip to content

Commit

Permalink
Clean up blog schema
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Sep 1, 2021
1 parent 0264f8e commit e5c0868
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
6 changes: 0 additions & 6 deletions examples/blog/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ type Author {
skip: Int! = 0
): [Post!]
postsCount(where: PostWhereInput! = {}): Int
noUpdate: String
noCreate: String
}

input AuthorWhereUniqueInput {
Expand All @@ -141,8 +139,6 @@ input AuthorUpdateInput {
name: String
email: String
posts: PostRelateToManyForUpdateInput
noRead: String
noCreate: String
}

input PostRelateToManyForUpdateInput {
Expand All @@ -161,8 +157,6 @@ input AuthorCreateInput {
name: String
email: String
posts: PostRelateToManyForCreateInput
noRead: String
noUpdate: String
}

input PostRelateToManyForCreateInput {
Expand Down
12 changes: 4 additions & 8 deletions examples/blog/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ model Post {
}

model Author {
id String @id @default(cuid())
name String?
email String? @unique
posts Post[] @relation("Post_author")
noRead String?
noUpdate String?
noCreate String?
noExist String?
id String @id @default(cuid())
name String?
email String? @unique
posts Post[] @relation("Post_author")
}
4 changes: 0 additions & 4 deletions examples/blog/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export const lists = createSchema({
name: text({ isRequired: true }),
email: text({ isRequired: true, isIndexed: 'unique' }),
posts: relationship({ ref: 'Post.author', many: true }),
noRead: text({ graphql: { omit: ['read'] } }),
noUpdate: text({ graphql: { omit: ['update'] } }),
noCreate: text({ graphql: { omit: ['create'] } }),
noExist: text({ graphql: { omit: true } }),
},
}),
});

0 comments on commit e5c0868

Please sign in to comment.