View Source Absinthe.Formatter (absinthe v1.7.8)

Formatter task for graphql

Will format files with the extensions .graphql or .gql

Example

Absinthe.Formatter.format("{ version }")
"{
  version
}
"

From Elixir 1.13 onwards the Absinthe.Formatter can be added to the formatter as a plugin:

# .formatter.exs
[
  # Define the desired plugins
  plugins: [Absinthe.Formatter],
  # Remember to update the inputs list to include the new extensions
  inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{lib,priv}/**/*.{gql,graphql}"]
]

Summary

Functions