gitfrosh / lotr-api

This repository holds the code base of the API to rule them all, the Lord of the Rings api, which provides you with book, character, movie and quotes data.
https://the-one-api.dev
238 stars 66 forks source link

Add GraphQL support #16

Open gitfrosh opened 4 years ago

gitfrosh commented 4 years ago

Although REST is doing great for The one API, it would be nice to add and expose a GraphQL endpoint in the future.

Any help is appreciated. 🚀

WiLLiAM111333 commented 3 years ago

This might require some refactoring in your controllers and some helper functions to get all books as an example, are you sure you want this? Don't get me wrong I'd be happy to do it.

WiLLiAM111333 commented 3 years ago

I've already started working on it, I'd be happy to change my strategy up if you dont like the small refactors in the PR coming sometime this week.

EDIT: I say we keep the authentication part full REST so we dont get any issues with graphql returning the hashed password as a url query param or something stupid

gitfrosh commented 3 years ago

Hey, just to make sure: I'd like to provide an additional / seperate GraphQL endpoint (maybe something like the-one-api.dev/v2/graphql/), that leaves the existing REST API spec as it is. Of course there might be some refactoring necessary. But if you came up with a first solution, you are welcome to set up a PR. 🚀