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
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
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
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:
AbsintheGenerator.Schema
AbsintheGenerator.Mutation
AbsintheGenerator.Query
AbsintheGenerator.Resolver
AbsintheGenerator.Type
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
This library favors output format over template format and therefore has some sacrifices made in the favor of well formatted output code