I'm basically trying to instrument GraphQL queries to identify what queries and fields the user is hitting the most. For this I want to extract the query name and it's respective fields whenever the point
graphQL.execute(query) hits in my code.
I've seen some posts that were using/suggesting to use Apollo server but I do not use Apollo. For example in this query
query getMultipleResults {
personSearch(text: "xyz") {
totalCount
results {
name
dob
SSN
}
}
}
I would like to get the query name: personSearch and the fields to be: totalCount, results and its fields name, dob and SSN.