Codegen for forall query edges and faces.