Also, already in the development version (will be available with ArviZ 0.13) you can also use:
posterior = az.extract(idata)
which defaults to this behaviour but it is also possible to request a random subset of the samples (for plotting without crowding the figure too much for example). There are also other examples of working with InferenceData in Working with InferenceData — ArviZ dev documentation. The schema doc linked above is more descriptive, depending on what you are searching for you should read one or the other. As first contact ever with InferenceData however, I’d recommend the “working with inferencedata” page or this other one: Introduction to xarray, InferenceData, and netCDF for ArviZ — ArviZ dev documentation