View Source Absinthe.Formatter (absinthe v1.7.1)

Formatter task for graphql

Will format files with the extensions .graphql or .gql

example

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}"]
]

Link to this section Summary

Link to this section Functions