files/en-us/web/api/webgl2renderingcontext/getquery/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGL2RenderingContext.getQuery() method of the WebGL 2 API returns the currently active
{{domxref("WebGLQuery")}} for the target, or null.
getQuery(target, pname)
target
gl.ANY_SAMPLES_PASSED
gl.ANY_SAMPLES_PASSED_CONSERVATIVE
gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
pname
gl.CURRENT_QUERY.A {{domxref("WebGLQuery")}} object.
const currentQuery = gl.getQuery(gl.ANY_SAMPLES_PASSED, gl.CURRENT_QUERY);
{{Specifications}}
{{Compat}}