https://kotlinlang.org logo
Title
a

Alexander Suraphel

01/10/2022, 12:22 PM
Do KGraphql or ExpediaGroup’s graphql-kotlin allow you to automatically generate graphql schema based your domains(db schema)?
d

Dariusz Kuc

01/10/2022, 4:03 PM
not familiar with
KGraphQL
but in case of
graphql-kotlin
we generate schemas from your source code -> so it could generate the schema if you have your DB structure represented in the code. Personally I believe that GraphQL works best as an abstraction of your domain/db data into something that is usable for your experience layer so I would expose some transformed data views instead.
graphql-kotlin
does not generate schema directly from DB. If you want to expose your DB schema directly then take a look at
hasura
as it might fit your needs.
a

Alexander Suraphel

01/10/2022, 4:06 PM
@Dariusz Kuc thanks. Actually I was planning to use it alongside SqlDelight. I would have to create the schema myself that way I think.
d

Dariusz Kuc

01/10/2022, 4:09 PM
Not familiar with
SqlDelight
. I'd assume you might be able to use those files to generate the schema but it might get troublesome due to interfaces/methods (you could workaround it using schema generator hooks but it might be simpler to create separate GraphQL schema files from which you would call sql stuff)
:thank-you: 1
a

Alexander Suraphel

01/10/2022, 4:20 PM
Thanks @Dariusz Kuc i’ll experiment and ask questions when they come up
👍 1