https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
m

Marco Pierucci

03/10/2023, 11:55 AM
This might be a silly question but is there an apollo artifact/know third party library for parsing graphql files? I'd like to generate a report of the mutation/queries the app defines so my BE team knows if they change something that might break the app for example
b

bod

03/10/2023, 11:56 AM
There are no silly questions 🙂 You should be able to use apollo-ast for that.
m

Marco Pierucci

03/10/2023, 11:58 AM
oh that looks exactly what I need! cheers!
w

wasyl

03/10/2023, 12:32 PM
If you want some lint checks you should see if https://github.com/B2o5T/graphql-eslint does what you need already
m

Marco Pierucci

03/10/2023, 3:07 PM
This is linting right? Im looking to generate a easy scannable ( probable html ) report of the operations consumed
but thanks!
w

wasyl

03/10/2023, 3:17 PM
Ah, well yes it's linting, just you mentioned
so my BE team knows if they change something that might break the app for example
and we're using
graphql-eslint
for that use case exactly — given schema and operations, eslint can report where the two are incompatible. So we run it on our operations against new schema (on backend PRs) to make sure that the changes won't break anything
m

Marco Pierucci

03/10/2023, 3:52 PM
Oh I see! that sounds quite good! but how are you connecting your app defined operations to your BE PRs? Anyway sorry I divert will deffo take a look. Cheers!
w

wasyl

03/10/2023, 3:59 PM
BE PRs have a github action that will (with some hand waving) checkout graphql operations repo (separate one) at every commit that we know corresponds to an app release (based on tags from apps repositories) and will run the lint against schema from that PR (so, the proposed one). There isn't much magic there really, just wiring backend CI to run the lint check and figuring out where to get operations definitions from
m

Marco Pierucci

03/10/2023, 4:01 PM
I see, yeah something like that could really work. Thanks again!
y

Yang

03/11/2023, 2:04 PM
There’s also schema validation though some of the features are enterprise only https://www.apollographql.com/docs/graphos/delivery/schema-checks/
4 Views