0

Assuming you've identified queries to inspect on a relational database that are likely running into the pitfall of sending too many too small queries and want to figure out where they come from to give the team sending them a heads up, is there any way to tell what graphql query generated it from the compiled SQL output?

Doing things the other way around where you inspect the compiled output of a known graphql query is easy. But there doesn't seem to be any easy way of acting on feedback from the actual DB?

saolof
  • 1,097
  • 1
  • 15
  • 12

1 Answers1

1

The Hasura Query log is probably a good place to start. Do you have these logs enabled for your Hasura installation?

If you look for logs of type query-log you'll get a structured JSON object with properties that will have the operation name as well as the GQL query that was submitted to Hasura and the generated_sql that was produced.

You'd be able to match on the generated_sql and then find the actual GQL that caused it using that approach

Jesse Carter
  • 20,062
  • 7
  • 64
  • 101