Project-Books / books-api

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

Return covers 131 #141

Closed jhanna60 closed 2 years ago

jhanna60 commented 2 years ago

Summary of change

I have added the ability to now return covers in our GraphQL query, this is done in the form of a String to the path of the cover, I have also amended the DB scripts to reflect my changes, I have removed Cover_ID from the books table and all relationships going forward will be determined in the covers table allowing for multiple covers per book. We no longer needed the DB script to add cover ID so I removed this. I also added book primary key to the covers table and as this has a dependency on books I needed to move the script AFTER books were inserted. This left a gap in the sequence of scripts so I renamed them to bring them back in numerical order. Finally I also modified the README file to reflect the new format to supply to receive Covers, I also noticed that publisher didn't work so I renamed this to publishers and now the sample query works. The only thing slightly annoying me is that I had to set Cover fetching to type EAGER otherwise this wouldn't work, however I have noticed other objects also not loading correctly using LAZY but we don't reference them just yet so its a more deep rooted issue overall.

Related issue

Closes #131

Pull request checklist

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

For any checkbox that does not apply, still check it.

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

jhanna60 commented 2 years ago

Hey I realised IntelliJ tried to optimise imports for me and inserted a wildcard violating style guides, I've since amended this.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication