mix absinthe (absinthe_generator v0.1.1) View Source

AbsintheGenerator

Test Hex pm

Collection of mix tasks to help generate absinthe projects and schemas

This can be used to generate either individiual parts of your application or full sections

Installation

Available in Hex, the package can be installed by adding absinthe_generator to your list of dependencies in mix.exs:

def deps do
  [
    {:absinthe_generator, "~> 0.1"}
  ]
end

Using via Mix Task

We have a few commands we gain access to using this package:

mix absinthe              # Lists help for absinthe.gen. commands
mix absinthe.gen          # Lists help for absinthe.gen. commands
mix absinthe.gen.mutation # Generates an absinthe mutation schema and inserts the record in the base schema.ex
mix absinthe.gen.query    # Generates an absinthe query schema and inserts the record in the base schema.ex
mix absinthe.gen.resolver # Generates an absinthe resolver
mix absinthe.gen.schema   # Generates an absinthe schema
mix absinthe.gen.type     # Generates an absinthe type

Using via Code

This library also enables developers to create configs that pass into each portion and those configs can be utilized to generate absinthe portions. To see more on this please checkout the docs for:

Each of these modules defines a struct, when passed to the &AbsintheGenerator.Schema.run/1 function this will generate a string template for your file

Contributing

This library favors output format over template format and therefore has some sacrifices made in the favor of well formatted output code

Link to this section Summary

Functions

Callback implementation for Mix.Task.run/1.

Link to this section Functions

Callback implementation for Mix.Task.run/1.