This might be a silly question but is there an apo...
# apollo-kotlin
m
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
There are no silly questions 🙂 You should be able to use apollo-ast for that.
m
oh that looks exactly what I need! cheers!
w
If you want some lint checks you should see if https://github.com/B2o5T/graphql-eslint does what you need already
m
This is linting right? Im looking to generate a easy scannable ( probable html ) report of the operations consumed
but thanks!
w
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
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
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
I see, yeah something like that could really work. Thanks again!
y
There’s also schema validation though some of the features are enterprise only https://www.apollographql.com/docs/graphos/delivery/schema-checks/