stillsuit.lacinia.enums

Implementation functions related to translating enum values between lacinia and stillsuit.

make-enum-map

(make-enum-map config schema)

Look through a decorated lacinia schema, scanning its enum values. For each enum description, check for a :stillsuit/datomic-value key, representing what value the enum should have in the datomic database.

Return a map with an entry for each enum which contains such a key. Inside of this map will be two entries: :stillsuit/datomic-to-lacinia maps from datomic names to their lacinia enum counterparts, and :stillsuit/lacinia-to-datomic goes the other way. These maps are stored in the app context and used in stillsuit enum resolvers and the (stillsuit/datomic-enum) function.