Scattering and absorption of the H-polarized plane wave by the infinite grating of flat graphene strips are considered in the environment met most frequently-on or at the surface of a dielectric-slab substrate. The full-wave meshless code is based on the analytical semi-inversion using the Riemann-Hilbert problem solution. This leads to a Fredholm second-kind matrix equation for the Floquet harmonic amplitudes that guarantees code convergence and provides easy control of computational error, which can be reduced to machine precision. The matrix elements are combinations of elementary functions, and therefore, the code is accurate and quite economical. This enables computation of the reflectance, transmittance, and absorbance as a function of the frequency in the wide band from static case to 10 THz. Numerical results show that such a metasurface with micrometre-sized strips is a composite periodic open resonator. It is highly frequency-selective thanks to the interplay of three types of natural modes-low-Q slab, moderate-Q plasmon strip, and ultrahigh-Q lattice-that do not exist in the absence of the substrate. Varying the chemical potential of graphene, one can manipulate the electromagnetic characteristics of the metasurface at a fixed frequency from almost total transmission to almost total reflection.This is an open access article under the terms of the Creative Commons Attribution-NonCommercial-NoDerivs License, which permits use and distribution in any medium, provided the original work is properly cited, the use is non-commercial and no modifications or adaptations are made.