Chinese religion has no single canon and no central authority defining one, and the sources divide into kinds that were produced for entirely different reasons.
The oldest direct evidence is not literary at all. The oracle bones of the late Shang record divination addressed to ancestors and to a high power, and they survive because they were inscribed on bone and shell as an administrative act. They show a religion of royal ancestor consultation centuries before any of the texts a reader is likely to have heard of.
The Shanhaijing, a compilation of strange geography and its deities, preserves early material in a form that resists systematisation. The Daozang, the Daoist canon, is enormous, technical and largely liturgical, assembled over centuries and organised for practitioners rather than for readers seeking mythology.
Much of the narrative that ordinary people actually knew came from late vernacular fiction. The Fengshen Yanyi, a Ming novel, is where a great deal of the popular pantheon's arrangement was fixed in the public mind, and it is a work of entertainment that drew on existing cult rather than a record of doctrine.
Alongside all of this sits the imperial administrative record, which is unusually useful here: registers of recognised deities, canonisation edicts, temple gazetteers. When the state promoted a god it wrote the promotion down, so the career of a deity such as Mazu can be followed through official documents in a way that has no parallel in most other traditions.