To be fair, GraphQL manages to reign in the ludicrussness that is exporting a read only SQL connection to levels that are merely unpredictable instead of outright dangerous.
GraphQL does not prevent you or the GraphQL→DB translation layer from doing stupid things. Depending on the capabilities exposed by the GraphQL schema and the implementation of the translation layer, you can write a GraphQL query that is translated to 20 JOINs or N+1 hell or other bad things.