DevLifts / devlifts-api

MIT License
6 stars 4 forks source link

Create exercises routes #11

Open AlexandreResende opened 6 years ago

AlexandreResende commented 6 years ago

Some thoughts I came up with while developing this basic route.

1- I dont think we need different endpoints for filtering exercises. Instead, fitness-related projects, muscle group, equipment could be fields in the database and we could filter the search by it. So this way only one endpoint for search is needed. (Correct me if I am wrong)

2- Didnt create controller and model because the project does not have its database defined and I didnt wat to create a generic one. As soon as we define the database I can open other PRs. (I strongly suggest Postgres as a database, but the final choice is yours)

PS: I will track this repo because I want to help the product :)

mtliendo commented 6 years ago

+1 on this PR. I agree with not needing another route to filter. A better practice is to use a url param in REST, but with an ongoing discussion of using graphql, we'll likely have a mutation handle it for us.

AlexandreResende commented 6 years ago

Really want to help this API grow. However, as I am focusing on REST API, won't be able to learn GraphQL to be part of the group. I would be happy if the developed API followed the REST pattern so that I could help build this.

jacobherrington commented 5 years ago

In my opinion it's always a good idea to implement a REST api. Many developers and frameworks favor REST over GraphQL, eventually that may change.

Honestly, I'd rather have just a REST api over just a GraphQL api. If there are adequate resources, you can do both.