Skip to content
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

fix: fix quickstart schema about the nested create many #5985

Merged
merged 1 commit into from
May 8, 2024

Conversation

liyunfu1998
Copy link
Contributor

No description provided.

@janpio janpio requested a review from nikolasburk May 8, 2024 09:00
Copy link
Member

@nikolasburk nikolasburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @liyunfu1998, thanks a lot for this PR. I actually like the change to use [] because it illustrates that you can provide multiple objects to the create option in this nested write query.

However, I would like to make this point even more clear by including a second object then:

const user = await prisma.user.create({
  data: {
    name: 'Bob',
    email: '[email protected]',
    posts: {
      create: [{
        title: 'Hello World',
        published: true
      }, {
        title: 'My second post',
        content: 'This is still a draft.'
      }],
    },
  },
})
console.log(user)
}

Would you be open to making these additional changes?

If we change this, we also must make two other changes on that page:

  • update the line higlighting annotation on the code block accordingly (highlight=6-17;add)
  • update the terminal output in the "4.3. Explore relation queries with Prisma Client" section to include the data from the new post

Could you add these changes to the PR?

@liyunfu1998
Copy link
Contributor Author

Hey @liyunfu1998, thanks a lot for this PR. I actually like the change to use [] because it illustrates that you can provide multiple objects to the create option in this nested write query.

However, I would like to make this point even more clear by including a second object then:

const user = await prisma.user.create({
  data: {
    name: 'Bob',
    email: '[email protected]',
    posts: {
      create: [{
        title: 'Hello World',
        published: true
      }, {
        title: 'My second post',
        content: 'This is still a draft.'
      }],
    },
  },
})
console.log(user)
}

Would you be open to making these additional changes?

If we change this, we also must make two other changes on that page:

  • update the line higlighting annotation on the code block accordingly (highlight=6-17;add)
  • update the terminal output in the "4.3. Explore relation queries with Prisma Client" section to include the data from the new post

Could you add these changes to the PR?

thank you, i am updated pr, added highlight and findMany output

@nikolasburk nikolasburk self-requested a review May 8, 2024 12:22
Copy link
Member

@nikolasburk nikolasburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great now, thanks so much @liyunfu1998 🎉

@nikolasburk nikolasburk merged commit c5b6df6 into prisma:main May 8, 2024
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants