https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
l

Lenny

10/15/2020, 6:21 PM
hi folks, jeff from apollo tells me y’all (the expedia team) have figured out a way to check the generated SDL into source control that reflects changes to your kotlin classes — is that true? how does it work?
d

Dariusz Kuc

10/15/2020, 6:33 PM
hi 👋 yes we generate SDL as a build artifact and we use it for PR checks (schema validation) as well as an input to our gateway
tldr -> we build a custom plugin that generates the SDL unfortunately due to the current generator logic it is not easy to make it generic -> https://github.com/ExpediaGroup/graphql-kotlin/issues/705
l

Lenny

10/15/2020, 6:37 PM
cool, making a build artifact totally makes sense. but it’s not actually checked into source control right? you don’t have a .graphql file you can review?
d

Dariusz Kuc

10/15/2020, 6:40 PM
we store it in a database
l

Lenny

10/15/2020, 6:43 PM
cool cool that’s what we’re doing too … i think i confused jeff when i asked the question
i can’t think of a way to actually check in the graphql file without a gnarly precommit hook that no one would want
d

Dariusz Kuc

10/15/2020, 6:44 PM
also unsure how useful it would be to have this file checked in
as it could potentially change over every commit
l

Lenny

10/15/2020, 8:11 PM
yeah … some folks here want to code review SDLs instead of kotlin/go/ruby/whatever, but i’m on your side
j

Joe

10/16/2020, 4:59 PM
would a reasonable way to do this to have a "test" that sets up a GraphQL instance same as the app does and runs an introspection query to generate the build artifact, or is there a better still-not-generic way to generate the SDL?
d

Dariusz Kuc

10/16/2020, 5:14 PM
probably thats the easiest (i.e. starting up an app and running introspection or just retrieving sdl)
👍 1
2 Views