In reality, that's not the case, unfortunately. We have a lot of developers who just frankly ignore them. And so I think over time, our code base has gotten so large, as we said like we have 5,000 types and so many schemas, it's just not feasible for us to keep around these deprecated fields forever. So because we have versioned APIs and versioned schemas like Guy said, we're gonna start pretty soon being a little bit more aggressive about removing deprecated fields for that reason.
Around the V2 and V3 naming things, that was as Guy said, because of a limitation that we had in our versioning of process, that is now fixed. So hopefully those will never happen again, because frankly they're ugly and they're very confusing. Like which do I use? Price V2, V3, but I'm using the January release of the schema, but I'm using V2, it's just a mess, right? We all love to have nice APIs that are named nicely and are very OCD about things being consistent. So dropping V2s and V3s are something we definitely wanna do.
There's one question you had about monitoring usage, which we talked on a little bit, which is our API health that partners see. But also internally, we have dashboards that we can query and say, how many clients are hitting this specific field? That we use a lot to inform our decisions around when can we deprecate a field? If it is deprecated, how aggressive can we be about removing it in a future version? If this field is super, super popular, even though it's deprecated, maybe we ask ourselves why it's so popular? Like, is the new field not doing what it's supposed to, or is it not better than what we had anticipated? So I don't know if there's any open source tools for doing this. I know we have a open source gem called GraphQL metrics, which tracks more things around resolver execution times and whatnot, but internally, we have tools that says every query that comes in, we basically enumerate over every field that's requested and do it like a plus one, plus one. And that all goes into a dashboard behind the scenes that we can use to figure out when things can go away. But yeah, deprecated fields, honestly, they're great, but they can also be quite the pain to deal with. So we're looking for ways to improve that. Love to hear other people's thoughts on this. I know there's been talks in the GraphQL spec as well around arguments, because I believe arguments right now, you can't mark them as deprecated, which is just like built into the spec, which is interesting. So we've had to have some work around those as well. Yeah, I think there's a lot of work to be done in this space in general, around versioning APIs and breaking changes and like how to make them less painful, especially for mobile clients, like Tila said, because on mobile, once the app is out there, you can't technically force them to update. I mean, you can, but it's not the best UX, right? So, this is something we all have to think about. So yeah, definitely some room for innovation in this space. Yeah.
I'll add too, like in that, we obviously say like, Oh, we hate when fields are like money v2, money v3, or like money v7, because it feels pretty dirty. At the same time, like I think if your API is much smaller, it was a really big lift for us to implement an API versioning system, right? So, I don't think having a couple v2 fields is like the worst thing. I will say too, obviously you have to follow through on the process of like make a v2 field, get all your clients onto that v2 field, then get rid of your old field or change your old field and then migrate them back to the original money field, right? So I think it's like always a long process to get rid of those v2 v3s in your code base. But I think you can do it as like an easier lift without implementing like a full on versioning system. I don't know, those are my thoughts. Does everyone agree or disagree? Is it just bad and we shouldn't let anyone do it? Yeah. You got to work within the constraints of your system, I guess. Yeah, I think Alice said this perfectly earlier. Like, it's not a one size fits all solution. We're a little bit lucky because of the GraphQL Ruby Gen that we have supports a lot of things that we utilize to do versioning. And some of that has been a collaborative process, but if you're running like a node backend or something like the tools that you have available might be different. So this is just what has worked for us, but it's one size does not fit all. Oh, okay. We're going to hop over to Greg. Could I interrupt with a follow up question? Go for it. Do you track which applications are requesting the deprecated fields so that you could send out maybe like targeted messaging, like, hey, your application is still using an old field? Yeah. So the last link that I shared in the chat is for our API health report. So for that, it's like a partner. For us, the partner is a third party app developer. So we're tracking everything per apps so an app developer can go in and say like, oh, I'm using these fields. And these fields are going to be removed or change in functionality like three versions from now. And then as we get closer, we put a lot of thought into the communication plan for this, which I don't have an exact link for, but you can read about it on the shopify.dev website. As we get closer to the dates, we do send out email blasts just to remind people that like it's coming. Because you can tell someone like, hey, this field is going away in a year and they don't think it's something that they should urgently fix. So they need that like 30 day nudge or whatever it is, just to refresh their memory. Jonathan, did you wanna add something? Sorry. Nope. You said exactly what I was going to say. What you're gonna say, okay, cool. Sorry. Okay, Greg, if input unions existed today, would you use input unions instead of your one of? Interesting question. I guess I would say no still. Input unions have generated, I feel like a lot of enthusiasm about them. And they're always kind of the missing solution that we're always one step away and this problem will be solved by the input union. And I've heard that so many times and to go and find that really this one of thing just goes and solves it and it solves it better than anything that the input union could do, because it's still the input union wouldn't necessarily be able to go and do anything beyond just this is a set of input objects that I go and I put together and can receive these. And like the thing that we have today that we can do with incredibly simple server side validation can go and let us input scalers or lists or anything else. And it just, it accommodates so many more use cases and it's not even very difficult to do. So yeah, I'm sternly on the side of the fact that we don't necessarily need this spec and I hope it doesn't land. Cool, thanks for sharing your somewhat shaded views of input unions. This is... Feel free to provide the counter argument there. No, I don't feel like I can. You've basically convinced me. I'm on team one of... So Greg, this is a question for you but we'll open it up after as a question for everyone. When have you been trapped by not null constraints? Let's dive into nullability. Oh gosh, nullability. So I have a long history with nullability and it started from... My background before Shopify, I was working on distributed graph architectures.
Comments