https://kotlinlang.org logo
#kgraphql
Title
# kgraphql
j

janvladimirmostert

06/09/2019, 7:17 PM
it's been a while since i used kgraphql, does it support generics yet ?
j

jeggy

06/11/2019, 4:33 PM
No not yet
j

janvladimirmostert

06/11/2019, 10:04 PM
if i remember correctly, from looking at the source code, adding generics would have required major rework my use-case at the time was that i needed a base-class of type T and then let other classes extend that class got around that by copying and pasting all the base-fields everywhere, not very elegant, but it did the job
j

jeggy

06/12/2019, 7:56 AM
Sounds like you would be better of using a graphql union type instead? GraphQL in itself is also strongly typed, so you can't really use any generic types.
j

janvladimirmostert

06/12/2019, 7:58 AM
Had no idea there was a union type, just needed to get rid of a JS backend and replace it with Kotlin, so dropped KGraphQL in there. React + Apollo was mangling the JSON a bit, so had to adapt the JSON before sending it to the GraphQL parser. Will revisit GraphQL in the next project when i have to deal with something like this again
3 Views