ESchouten / CleanArchitecture

Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.
MIT License
320 stars 27 forks source link

Explore different Graphql servers #12

Open ESchouten opened 2 years ago

ESchouten commented 2 years ago

With KGraphQL development being stale since august 2021 and the developer going AWOL, other graphql server libraries should be considered.

Update JUNE 2022: KGraphQL author seems to have returned, looking for maintainers

Possible candidates: Kaguya GraphQL Kotlin Possible official KTOR Graphql support post 2.0 release

LSafer commented 2 years ago

I might add my implementation https://github.com/cufyorg/kaguya 😗

It is a kotlin-friendly wrapper for graphql-java with ktor integration

You might try the template https://github.com/cufyorg/ktor-graphql-template

ESchouten commented 2 years ago

@LSafer Looks very nice and clean! Will definitely investigate your library further soon, added it to the list above.

Francynox commented 2 years ago

@ESchouten I worked for a graphql-kotlin implementation. If you want to take a look at it it is in my fork

ESchouten commented 2 years ago

@Francynox very impressive! What's your impression of graphql-(java/kotlin)? How does it compare to kgraphql? Do you like it?

Francynox commented 2 years ago

sure, i want to make a list of pros and cons of the things saw in the library

Pros

Cons

Final tought in general i think the library is stable and his strength is definitely the schema generator; I think it has to be preferred over KGraphql as, in my opinion, its future is a bit uncertain.

ESchouten commented 2 years ago

@Francynox I agree with your points It seems a bit more powerful which might enable (or make easier) things like customizing parameter names, which are now a0, a1 etc.

The main thing I dislike about the library is how complex it is and how much more boilerplate is involved. The only thing we're using GraphQL for is the typed API, GraphQL is not integrated into our system.

Basically what I described in #18, btw what's your opinion on this statement + issue #18?

LSafer commented 2 years ago

@Francynox

I have the impression that it is a little bit slower in executing requests compared to KGraphql

No, its not. At least, not like what you think

KGraphQL uses reflection for invoking the resolver and it really rely on it, to the degree you can't escape it!

I don't know about the speed of kotlin reflection but it must be slower than no reflection.

Francynox commented 2 years ago

@ESchouten

The main thing I dislike about the library is how complex it is and how much more boilerplate is involved. The only thing we're using GraphQL for is the typed API, GraphQL is not integrated into our system.

You're corerct, but i think with a library like this we can integrate Graphql by adding things like recirsive queries only by manipulating the schema and the dataFetcher However, I don't know how much work it would actually take!

Basically what I described in #18, btw what's your opinion on this statement + issue #18?

Unfortunatelly i don't know much about OpenAPI but i think if we can add recursive queries successfully it would be nice to have Rest and Graphql both working

@LSafer

I don't know about the speed of kotlin reflection but it must be slower than no reflection.

You must be right! I have not tested the speed of KGraphql and graphql-kotlin properly, mine was just an on-screen impression, expecially with the LoginUser query

ESchouten commented 2 years ago

@Francynox I'm already serving a REST API in a separate project, will add it tomorrow or the day after. OpenAPI will come later, heard the Ktor team approximate late summer release.