graphql.servlet.internal.GraphQLRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-servlet Show documentation
Show all versions of graphql-java-servlet Show documentation
relay.js-compatible GraphQL servlet
package graphql.servlet.internal;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.HashMap;
import java.util.Map;
/**
* @author Andrew Potter
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class GraphQLRequest {
private String query;
@JsonDeserialize(using = VariablesDeserializer.class)
private Map variables = new HashMap<>();
private String operationName;
public GraphQLRequest() {
}
public GraphQLRequest(String query, Map variables, String operationName) {
this.query = query;
this.operationName = operationName;
if (variables != null) {
this.variables = variables;
}
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public Map getVariables() {
return variables;
}
public void setVariables(Map variables) {
if (variables != null) {
this.variables = variables;
}
}
public String getOperationName() {
if (operationName != null && !operationName.isEmpty()) {
return operationName;
}
return null;
}
public void setOperationName(String operationName) {
this.operationName = operationName;
}
}