Gamma-ray bursts (GRBs) are the brightest events in the universe. They have been used in the last five years to study the cosmic chemical evolution, from the local universe to the first stars. The sample size is still relatively small when compared to field galaxy surveys. However, GRBs show a universe that is surprising. At z > 2, the cold interstellar medium in galaxies is chemically evolved, with a mean metallicity of about 1/10 solar. At lower redshift (z < 1), metallicities of the ionized gas are relatively low, on average 1/6 solar. Not only is there no evidence of redshift evolution in the interval 0 < z < 6.3, but also the dispersion in the ~ 30 objects is large. This suggests that the metallicity of host galaxies is not the physical quantity triggering GRB events. From the investigation of other galaxy parameters, it emerges that active star-formation might be a stronger requirement to produce a GRB. Several recent striking results strongly support the idea that GRB studies open a new view on our understanding of galaxy formation and evolution, back to the very primordial universe at z ~ 8.