graphql.execution.MissingRootTypeException Maven / Gradle / Ivy
package graphql.execution;
import java.util.Collections;
import java.util.List;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.GraphQLException;
import graphql.PublicApi;
import graphql.language.SourceLocation;
/**
* This is thrown if a query is attempting to perform an operation not defined in the GraphQL schema
*/
@PublicApi
public class MissingRootTypeException extends GraphQLException implements GraphQLError {
private List sourceLocations;
public MissingRootTypeException(String message, SourceLocation sourceLocation) {
super(message);
this.sourceLocations = sourceLocation == null ? null : Collections.singletonList(sourceLocation);
}
@Override
public List getLocations() {
return sourceLocations;
}
@Override
public ErrorType getErrorType() {
return ErrorType.OperationNotSupported;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy