Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Add edition to schema #8

Open
knjk04 opened this issue Nov 21, 2020 · 3 comments
Open

Add edition to schema #8

knjk04 opened this issue Nov 21, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers graphql

Comments

@knjk04
Copy link
Member

knjk04 commented Nov 21, 2020

There should be an optional String edition field in the Book entity and schema

@knjk04 knjk04 added enhancement New feature or request good first issue Good for newcomers labels Nov 21, 2020
@ofvoler
Copy link
Contributor

ofvoler commented Nov 27, 2020

Can I take this issue?

@knjk04
Copy link
Member Author

knjk04 commented Nov 28, 2020

Thanks for your interest in this.

Unfortunately, I was meant to have blocked this because we need to re-think the design (a different book edition may have different book metadata, e.g. another author, so I think it'll be a little more involved than simply adding a String field).

I'd recommend #10, instead. It's a bit more challenging, but not hard by any means. I appreciate you've never used Spring before, but I think it's a good entry point to learn as you go along.


If you're interested, here's some more information:

If you take a look at example 5.7 here, you can see that you'll need to write some Java code, which Spring Data JPA will convert into the relevant database query (it can adapt depending on which database management system we're using, which is really nice!). You can find some examples of how we use derived queries in the repository package1 in the Book Project.

The derived query (the Java line that will get converted to SQL) will be quite simple. Table 3 shows you how to make the query case insensitive.

Lastly, we'll need some tests to ensure this works, which should give you (or whoever picks it up) good exposure to things like dependency injection and how to write good tests. We have examples in the Book Project on testing derived queries.

1 Spoiler alert: the same query we need here is implemented in BookRepository.java in the Book Project. You can check whether you've implemented the derived query and test correctly by comparing your solution to the implementation there. I'd recommend only checking that after implementing your solution, as you may come up with a better approach to testing it.

@knjk04 knjk04 added the blocked This issue is blocked by another issue or is not yet ready to be implemented label Nov 28, 2020
@knjk04 knjk04 added graphql and removed blocked This issue is blocked by another issue or is not yet ready to be implemented labels Mar 21, 2021
@knjk04
Copy link
Member Author

knjk04 commented Mar 21, 2021

Unblocked but we need to come up with an implementation approach

@knjk04 knjk04 self-assigned this Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers graphql
Projects
Status: No status
Development

No branches or pull requests

2 participants