Project-Books / books-api

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

Set up DGS code generation #63

Closed knjk04 closed 3 years ago

knjk04 commented 3 years ago

Add the DGS code generation build plugin and use the code generation in the data fetchers

https://netflix.github.io/dgs/generating-code-from-schema/

kev711 commented 3 years ago

Hi @knjk04,

Can I do this ?

knjk04 commented 3 years ago

Hi @kev711, sure. Thanks again!

kev711 commented 3 years ago

I see there are a few query type specs created in resources\schema. Do we need to create data fetchers on basis of query type or Repository methods in Entity Repositories ?

knjk04 commented 3 years ago

The repository methods, please

kev711 commented 3 years ago

I tried generating data fetchers using code generation (generateJava task). It seems to generate only boilerplate code with dummy methods. Rest has to be done manually. Also, I see all but one method defined in com.karankumar.booksapi.datafetchers.BookDataFetcher. So I'm not sure what needs to be done here...

knjk04 commented 3 years ago

Things like constants and the query builder for testing. See this video

knjk04 commented 3 years ago

@kev711 How are you getting on with this?

kev711 commented 3 years ago

@knjk04 , I'm running a bit busy so I'll un assign myself from this one.

knjk04 commented 3 years ago

@kev711 OK, thanks for letting us know