Skip to content

Commit

Permalink
createMany should't be a list field
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Jul 26, 2024
1 parent 50c7e40 commit 6e88277
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-prisma-utils/src/schema-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ schemaBuilder.prismaUpdateRelation = function prismaUpdateRelation<

fieldDefs[field] = t.field({
required: false,
type: [nestedRef],
type: nestedRef,
});
} else if ((field === 'disconnect' || field === 'delete') && fieldOption === true) {
fieldDefs[field] = t.field({
Expand Down
24 changes: 12 additions & 12 deletions packages/plugin-prisma-utils/tests/examples/codegen/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ input MediaUpdate {
input MediaUpdatePostsRelationInput {
connect: [PostMediaUniqueFilter!]
create: [PostMediaCreateWithoutMedia!]
createMany: [MediaUpdatePostsRelationInputCreateMany!]
createMany: MediaUpdatePostsRelationInputCreateMany
delete: [PostMediaUniqueFilter!]
deleteMany: [PostMediaWithoutMediaFilter!]
disconnect: [PostMediaUniqueFilter!]
Expand Down Expand Up @@ -1016,7 +1016,7 @@ input PostUpdateAuthorRelationInput {
input PostUpdateCommentsRelationInput {
connect: [CommentUniqueFilter!]
create: [CommentCreateWithoutPost!]
createMany: [PostUpdateCommentsRelationInputCreateMany!]
createMany: PostUpdateCommentsRelationInputCreateMany
delete: [CommentUniqueFilter!]
deleteMany: [CommentWithoutPostFilter!]
disconnect: [CommentUniqueFilter!]
Expand All @@ -1043,7 +1043,7 @@ input PostUpdateCommentsRelationInputUpdateMany {
input PostUpdateMediaRelationInput {
connect: [PostMediaUniqueFilter!]
create: [PostMediaCreateWithoutPost!]
createMany: [PostUpdateMediaRelationInputCreateMany!]
createMany: PostUpdateMediaRelationInputCreateMany
delete: [PostMediaUniqueFilter!]
deleteMany: [PostMediaWithoutPostFilter!]
disconnect: [PostMediaUniqueFilter!]
Expand Down Expand Up @@ -1410,7 +1410,7 @@ input UserUpdate {
input UserUpdateCommentsRelationInput {
connect: [CommentUniqueFilter!]
create: [CommentCreateWithoutAuthor!]
createMany: [UserUpdateCommentsRelationInputCreateMany!]
createMany: UserUpdateCommentsRelationInputCreateMany
delete: [CommentUniqueFilter!]
deleteMany: [CommentWithoutAuthorFilter!]
disconnect: [CommentUniqueFilter!]
Expand All @@ -1437,7 +1437,7 @@ input UserUpdateCommentsRelationInputUpdateMany {
input UserUpdateFollowersRelationInput {
connect: [FollowUniqueFilter!]
create: [FollowCreateWithoutTo!]
createMany: [UserUpdateFollowersRelationInputCreateMany!]
createMany: UserUpdateFollowersRelationInputCreateMany
delete: [FollowUniqueFilter!]
deleteMany: [FollowWithoutToFilter!]
disconnect: [FollowUniqueFilter!]
Expand All @@ -1464,7 +1464,7 @@ input UserUpdateFollowersRelationInputUpdateMany {
input UserUpdateFollowingRelationInput {
connect: [FollowUniqueFilter!]
create: [FollowCreateWithoutFrom!]
createMany: [UserUpdateFollowingRelationInputCreateMany!]
createMany: UserUpdateFollowingRelationInputCreateMany
delete: [FollowUniqueFilter!]
deleteMany: [FollowWithoutFromFilter!]
disconnect: [FollowUniqueFilter!]
Expand All @@ -1491,7 +1491,7 @@ input UserUpdateFollowingRelationInputUpdateMany {
input UserUpdateMediaRelationInput {
connect: [MediaUniqueFilter!]
create: [MediaCreateWithoutUploadedBy!]
createMany: [UserUpdateMediaRelationInputCreateMany!]
createMany: UserUpdateMediaRelationInputCreateMany
delete: [MediaUniqueFilter!]
deleteMany: [MediaWithoutUploadedByFilter!]
disconnect: [MediaUniqueFilter!]
Expand All @@ -1518,7 +1518,7 @@ input UserUpdateMediaRelationInputUpdateMany {
input UserUpdatePostsRelationInput {
connect: [PostUniqueFilter!]
create: [PostCreateWithoutAuthor!]
createMany: [UserUpdatePostsRelationInputCreateMany!]
createMany: UserUpdatePostsRelationInputCreateMany
delete: [PostUniqueFilter!]
deleteMany: [PostWithoutAuthorFilter!]
disconnect: [PostUniqueFilter!]
Expand Down Expand Up @@ -1657,7 +1657,7 @@ input WithCompositeIDUpdate {
input WithCompositeIDUpdateFindUniqueRelationsRelationInput {
connect: [FindUniqueRelationsUniqueFilter!]
create: [FindUniqueRelationsCreateWithoutWithCompositeID!]
createMany: [WithCompositeIDUpdateFindUniqueRelationsRelationInputCreateMany!]
createMany: WithCompositeIDUpdateFindUniqueRelationsRelationInputCreateMany
delete: [FindUniqueRelationsUniqueFilter!]
deleteMany: [FindUniqueRelationsWithoutWithCompositeIDFilter!]
disconnect: [FindUniqueRelationsUniqueFilter!]
Expand Down Expand Up @@ -1734,7 +1734,7 @@ input WithCompositeUniqueUpdate {
input WithCompositeUniqueUpdateFindUniqueRelationsRelationInput {
connect: [FindUniqueRelationsUniqueFilter!]
create: [FindUniqueRelationsCreateWithoutWithCompositeUnique!]
createMany: [WithCompositeUniqueUpdateFindUniqueRelationsRelationInputCreateMany!]
createMany: WithCompositeUniqueUpdateFindUniqueRelationsRelationInputCreateMany
delete: [FindUniqueRelationsUniqueFilter!]
deleteMany: [FindUniqueRelationsWithoutWithCompositeUniqueFilter!]
disconnect: [FindUniqueRelationsUniqueFilter!]
Expand Down Expand Up @@ -1800,7 +1800,7 @@ input WithIDUpdate {
input WithIDUpdateFindUniqueRelationsRelationInput {
connect: [FindUniqueRelationsUniqueFilter!]
create: [FindUniqueRelationsCreateWithoutWithID!]
createMany: [WithIDUpdateFindUniqueRelationsRelationInputCreateMany!]
createMany: WithIDUpdateFindUniqueRelationsRelationInputCreateMany
delete: [FindUniqueRelationsUniqueFilter!]
deleteMany: [FindUniqueRelationsWithoutWithIDFilter!]
disconnect: [FindUniqueRelationsUniqueFilter!]
Expand Down Expand Up @@ -1864,7 +1864,7 @@ input WithUniqueUpdate {
input WithUniqueUpdateFindUniqueRelationsRelationInput {
connect: [FindUniqueRelationsUniqueFilter!]
create: [FindUniqueRelationsCreateWithoutWithUnique!]
createMany: [WithUniqueUpdateFindUniqueRelationsRelationInputCreateMany!]
createMany: WithUniqueUpdateFindUniqueRelationsRelationInputCreateMany
delete: [FindUniqueRelationsUniqueFilter!]
deleteMany: [FindUniqueRelationsWithoutWithUniqueFilter!]
disconnect: [FindUniqueRelationsUniqueFilter!]
Expand Down
16 changes: 8 additions & 8 deletions packages/plugin-prisma-utils/tests/examples/crud/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ input MediaUniqueFilter {
input MediaUpdatePostsRelationInput {
connect: [PostMediaUniqueFilter!]
create: [PostMediaCreateWithoutMediaInput!]
createMany: [MediaUpdatePostsRelationInputCreateMany!]
createMany: MediaUpdatePostsRelationInputCreateMany
delete: [PostMediaUniqueFilter!]
deleteMany: [PostMediaWithoutMediaFilter!]
disconnect: [PostMediaUniqueFilter!]
Expand Down Expand Up @@ -578,7 +578,7 @@ input PostUpdateAuthorRelationInput {
input PostUpdateCommentsRelationInput {
connect: [CommentUniqueFilter!]
create: [CommentCreateWithoutPostInput!]
createMany: [PostUpdateCommentsRelationInputCreateMany!]
createMany: PostUpdateCommentsRelationInputCreateMany
delete: [CommentUniqueFilter!]
deleteMany: [CommentWithoutPostFilter!]
disconnect: [CommentUniqueFilter!]
Expand Down Expand Up @@ -621,7 +621,7 @@ input PostUpdateInput {
input PostUpdateMediaRelationInput {
connect: [PostMediaUniqueFilter!]
create: [PostMediaCreateWithoutPostInput!]
createMany: [PostUpdateMediaRelationInputCreateMany!]
createMany: PostUpdateMediaRelationInputCreateMany
delete: [PostMediaUniqueFilter!]
deleteMany: [PostMediaWithoutPostFilter!]
disconnect: [PostMediaUniqueFilter!]
Expand Down Expand Up @@ -900,7 +900,7 @@ input UserUniqueFilter {
input UserUpdateCommentsRelationInput {
connect: [CommentUniqueFilter!]
create: [CommentCreateWithoutAuthorInput!]
createMany: [UserUpdateCommentsRelationInputCreateMany!]
createMany: UserUpdateCommentsRelationInputCreateMany
delete: [CommentUniqueFilter!]
deleteMany: [CommentWithoutAuthorFilter!]
disconnect: [CommentUniqueFilter!]
Expand All @@ -927,7 +927,7 @@ input UserUpdateCommentsRelationInputUpdateMany {
input UserUpdateFollowersRelationInput {
connect: [FollowUniqueFilter!]
create: [FollowCreateWithoutToInput!]
createMany: [UserUpdateFollowersRelationInputCreateMany!]
createMany: UserUpdateFollowersRelationInputCreateMany
delete: [FollowUniqueFilter!]
deleteMany: [FollowWithoutToFilter!]
disconnect: [FollowUniqueFilter!]
Expand All @@ -954,7 +954,7 @@ input UserUpdateFollowersRelationInputUpdateMany {
input UserUpdateFollowingRelationInput {
connect: [FollowUniqueFilter!]
create: [FollowCreateWithoutFromInput!]
createMany: [UserUpdateFollowingRelationInputCreateMany!]
createMany: UserUpdateFollowingRelationInputCreateMany
delete: [FollowUniqueFilter!]
deleteMany: [FollowWithoutFromFilter!]
disconnect: [FollowUniqueFilter!]
Expand Down Expand Up @@ -993,7 +993,7 @@ input UserUpdateInput {
input UserUpdateMediaRelationInput {
connect: [MediaUniqueFilter!]
create: [MediaCreateWithoutUploadedByInput!]
createMany: [UserUpdateMediaRelationInputCreateMany!]
createMany: UserUpdateMediaRelationInputCreateMany
delete: [MediaUniqueFilter!]
deleteMany: [MediaWithoutUploadedByFilter!]
disconnect: [MediaUniqueFilter!]
Expand All @@ -1020,7 +1020,7 @@ input UserUpdateMediaRelationInputUpdateMany {
input UserUpdatePostsRelationInput {
connect: [PostUniqueFilter!]
create: [PostCreateWithoutAuthorInput!]
createMany: [UserUpdatePostsRelationInputCreateMany!]
createMany: UserUpdatePostsRelationInputCreateMany
delete: [PostUniqueFilter!]
deleteMany: [PostWithoutAuthorFilter!]
disconnect: [PostUniqueFilter!]
Expand Down

0 comments on commit 6e88277

Please sign in to comment.