Photoelectron spectroscopy (PES) and microscopy are highly demanded for exploring morphologically complex solid-gas and solid-liquid interfaces under realistic conditions, but the very small electron mean free path inside the dense media imposes serious experimental challenges. Currently, near ambient pressure PES is conducted using sophisticated and expensive electron energy analyzers coupled with differentially pumped electron lenses. An alternative economical approach proposed in this report uses ultrathin graphene membranes to isolate the ambient sample environment from the PES detection system. We demonstrate that the graphene membrane separating windows are both mechanically robust and sufficiently transparent for electrons in a wide energy range to allow PES of liquid and gaseous water. The reported proof-of-principle experiments also open a principal possibility to probe vacuum-incompatible toxic or reactive samples enclosed inside the hermetic environmental cells.