  Models of chemical enrichment and inhomogeneity in high-redshift galaxies are
challenging to constrain observationally. In this work, we discuss a novel
approach to probe chemical inhomogeneities within long Gamma-Ray Burst (GRB)
host galaxies, by comparing the absorption metallicity, Z_abs, from the GRB
afterglow (which probes the environment along the line of sight) with the
emission-line metallicity, Z_emiss, measured via slit spectroscopy. Using the
IllustrisTNG simulation, the theoretical relationship between these metallicity
metrics is explored for a range of GRB formation models, varying the GRB
progenitor metallicity threshold. For galaxies with fixed Z_emiss, the median
value of Z_abs depends strongly on the GRB progenitor threshold metallicity,
with Z_abs significantly lower than Z_emiss for high metallicity hosts.
Conversely, at fixed Z_abs, the median value of Z_emiss depends primarily on
the metallicity distribution of galaxies in IllustrisTNG and their chemical
inhomogeneities, offering a GRB-model-independent way to constrain these
processes observationally. Currently, only one host galaxy has data for both
absorption and emission metallicities (GRB121014A). We re-analyse the emission
spectrum and compare the inferred metallicity Z_emiss to a recent Bayesian
determination of Z_abs, finding $\log(Z_{\rm emiss}/Z_{\odot}) = \log(Z_{\rm
abs}/Z_{\odot}) +0.35^{+ 0.14}_{- 0.25}$, within ~2 standard deviations of
predictions from the IllustrisTNG simulation. Future observations with the
James Webb Space Telescope will be able to measure Z_emiss for 4 other GRB
hosts with known Z_abs values, using ~2 hour observations. While small, the
sample will provide preliminary constraints on the Z_abs-Z_emiss relation to
test chemical enrichment schemes in cosmological simulations.
