Project-Books / books-api

GraphQL Books API
https://project-books.github.io/#books-api
MIT License
35 stars 61 forks source link

Fix seed data to have findByAuthor return expected data #116

Closed maines-pet closed 3 years ago

maines-pet commented 3 years ago

Summary of change

Move all book repository save call after associating the book instances with the author instances in BooksApiApplication.populateData.

CascadeType.Remove set in Author and Book model classes to avoid DataIntegrityViolationException in tests

Related issue

Closes #74

Pull request checklist

Please keep this checklist in & ensure you have done the following:

For any of the optional checkboxes (e.g. the screenshots one), still check it if it does not apply.

If in doubt, get in touch with us via our Slack workspace or by creating a new Q&A discussion on GitHub

maines-pet commented 3 years ago

Hi @knjk04, I have closed #111 and created this PR instead. PR ready for review.