I have a custom resolver in my Slash GraphQL DB. It simply executes a REST call to my image signer API that takes the file name, requests a signed URL from google storage, then returns the signed URL. This whole thing shouldn’t take a lot of time or resources… but it feels sluggish.
Now… I’ve already tracked down some performance issues in my signing API and I’ve deployed serverless in Cloud Functions. And I suspect that’s where the bulk of my performance issues lie. However… out of due diligence, I wanted to reach out and see if I can find out what’s happening under the covers with custom resolvers.
Are these resolvers executed asynchronously or are they executed one at a time? For example… for my image signer, the custom resolver is on a field. So, if a page has 100 images on it, it’ll call the API 100 times. There would be a pretty huge difference between Dgraph waiting for each element in the array to complete the call to my API before moving on to the next one. Compared to firing off the call across the board, then waiting for all to complete before returning the entire object.
So… what’s going on under the covers?