Marco Ippolito
Marco Ippolito
Marco Ippolito is a software developer at NearForm with a focus on backend development. He is a maintainer of Mercurius-js and has made significant contributions to the open-source community, particularly in the Node.js ecosystem.
Node Congress 2023Node Congress 2023
7 min
Measuring the Cost of a GraphQL Query with mercurius-explain
The development experience with GraphQL makes for a simple and immediate way to access data. Working on the backend means focusing on how and where the data is obtained from, whereas the frontend focuses on retrieving the data necessary for computation and display. This freedom of action, however, hides some possible performance problems. Fragments let you construct sets of fields, and then include them in queries where they’re needed. Often a client requests unnecessary data in an API call with the assumption that the extra fields are free. Instead, they are the cause of extra queries, sometimes even expensive ones. Not knowing the cost of a query makes it impossible to perform optimisation correctly.