Codec for generating Absinthe JSON schemas in a deterministic format with alphabetically ordered type definitions

Latest version: 1.0.1 registry icon
Maintenance score
Safety score
Popularity score
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Version Suggest Low Medium High
1.0.1 0 0 0 0
1.0.0 0 0 0 0

Latest release:

1.0.1 - this version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform


Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant

Absinthe Sorting Codec

Build Status Hex pm Hex Docs License

Convert the JSON output of an introspection query into a deterministic ordering of types (sorted by name). This results in saner diffs when committing schemas to version control.


Can convert the output of introspection queries in JSON format to a sorted, deterministic ordering of types. See the test fixtures.




Can be used to convert an Absinthe schema to a deterministic format by using AbsintheSortingCodec as the JSON encoder.


mix absinthe.schema.json --schema MySchema --json-codec AbsintheSortingCodec --pretty

NOTE: If the mix command gives the following error --

(Argument Error) you atttempted to apply :module on "AbsintheSortingCodec". If you are using apply/3, make sure the module is an atom. If you are using the dot syntax, such as map.field or module.function, make sure the left side of the dot is an atom or a map

-- you need to upgrade to Absinthe 1.4.14 or 1.5 or later.


If available in Hex, the package can be installed by adding absinthe_sorting_codec to your list of dependencies in mix.exs:

def deps do
    {:absinthe_sorting_codec, "~> 1.0.1"}

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/absinthe_sorting_codec.


Thanks to Maarten van Vliet for developing Absinthe SDL, which this project is patterned after.