3

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.

1 Answer 1

1

While creating the graphql schema, you can define the instrumentation type. While every graphql execution, get the execution result which has the tracing information in details about fields ,time and resolver. for more information please refer my GitHub account : AnkushNakaskar with project "springbootspqrgraphql" For tracing : please add "TracingInstrumentation" for tracing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.