Replies: 2 comments 3 replies
-
Could you share some example queries and responses for these? The problem is, "a query" in GraphQL can refer to very different things, depending on how much work the server has to do to build a response. For example, consider this query string: query($companyId: ID!) {
company(id: $companyId) {
employees { name }
}
} Depending on the company ID, the query above may prepare a response with only a few objects in the response (for a company with a few employees) or it may prepare a response with bazillions of objects (for a multinational conglomerate megacorp). So, without some domain understanding, it's hard to make sense of it 😅 |
Beta Was this translation helpful? Give feedback.
-
The queries we have all contain numerous connections and fields (some arrays). They get quite large. It makes sense that the response is tied to the complexity of building the response, especially in a case similar to your example. However, newrelic is logging data fetching as separate transaction instances. This makes me think that there's additional work done by the graphql gem here and I'd like to understand what it would be. Rather than pasting queries and responses, I thought it may make more sense to instrument the response with more insight into that "execute" chunk. |
Beta Was this translation helpful? Give feedback.
-
Looking for some insights into graphql tracing. Specifically a newrelic report, but I'm sure other tracers have similar behaviours. My goal is to see if there are any performance optimizations.
My understanding is that there are a few actions tied to the
GraphQL/execute
key, specifically:On newrelic, we have some key transactions that we monitor. A couple of them have the behaviour where almost half the response time is spent doing
GraphQL/execute
Example response times. Brown is the time spent executing and blue is the total response time
The reason why I feel like there are optimizations to be made here is because we also have queries where the
GraphQL
component of the request is very fast, example purple and yellow areexecute
, green isvalidate
:There are 3 transactions for
GraphQL/execute
per query, is my thinking that all of the previously mentionedplatform_keys
get executed each one time correct?Graphql language parsing is foreign to me so it's entirely possible that there are no gains to be made other than a smaller query / less fields. Would less nesting help this? Or is there some other trick involving structure of your fields?
Is it there any possible way / configuration to get a deeper understanding into what this
execute
transaction is doing?Since most of the query is the same except a few arguments, is there possible cache gains here?
Thanks
cc @rmosolgo, Apologies for the tag, I understand you're busy. I thought you may have the best insight into this.
Beta Was this translation helpful? Give feedback.
All reactions