https://kotlinlang.org logo
a

agrosner

06/29/2023, 6:37 PM
hey! now that we have the intellij plugin, is there any plans to introduce linting around unused graphql fields? you know the usages of the graphql + generated kotlin files. now if the next step to discover unused field references
👍 1
r

Ryan Brink

06/29/2023, 8:03 PM
wouldn't that only work under the assumption that that particular app was the only consumer of the api?
a

agrosner

06/29/2023, 11:34 PM
Correct!
b

bod

06/30/2023, 8:34 AM
Yes! Totally under our radar 🙂 At the moment I haven't found a way to implement "Find usages" on operation fields (which is a similar mechanism), but we want to have it.
Hello, World! In the latest weekly snapshot, unused operations and fields are detected and shown in grey 🙂 If you have the chance to test it, feedback is appreciated!
r

Ryan Brink

07/10/2023, 12:02 PM
The use case feels kinda limited IMO, since it relies on the idea that you are the sole consumer of the API. Is there a way to turn this off for people who don't want this?
b

bod

07/10/2023, 12:04 PM
Is there a way to turn this off for people who don't want this?
yes, it's in the inspections settings (you can access it from the warning itself)
Screenshot 2023-07-10 at 14.05.48.png
r

Ryan Brink

07/10/2023, 12:10 PM
OH i see... you guys show this for the queries... that makes sense! For some reason, I had it in my head that you showed this on the schema (if that was present in the repo). I'm on board now 🫡 🫡
b

bod

07/10/2023, 12:10 PM
ahhh yes I can see how you could think that! 🙂
(your remark still makes sense, if you're building a library, then consumers of the operation can be in other projects that the plugin isn't aware of)
a

agrosner

07/10/2023, 12:16 PM
Woah!!! I’ll have to give it a spin
This will be hugely useful for our 300+ module app as we migrate from gson, reflection, and an in house graphql system where response models were shared 🤪 and we didn’t know what was truly used or not without a lot of investigation . It’ll help keep our queries and code optimized
b

bod

07/10/2023, 12:21 PM
very cool! I hope it'll work as expected 🤞