I am creating a rest api using graphql. I want to log the query fired by user in the java program. I cannot access the query in the program. Following is the piece of code I have written:
package com.x.demo.GraphQL.Resolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.x.demo.GraphQL.Model.Employee;
import com.x.demo.GraphQL.Services.EmployeeService;
@Component
public class MutationResolver implements GraphQLMutationResolver{
@Autowired
private EmployeeService employeeService;
public Employee createEmployee(String name, String profile, String DOJ, String salary) {
return this.employeeService.createEmployee(name, profile, DOJ, salary);
}
}
here I want to log the query in function create employee. Any help will be deeply appreciated.