GraphQL v0.3.2 Mix.Tasks.Compile.Graphql

Compiles .graphql files which have changed since the last generation.

Currently only handles schema files, but will support queries in future.

To use this you need to add the :graphql compiler to the front ofyour compiler chain. This just needs to be anywhere before the Elixir compiler because we are generating Elixir code.

In your mix.exs project in a Phoenix project for example:

compilers: [:phoenix, :graphql] ++ Mix.compilers

You also need to tell the GraphQL compiler which files to pick up.

In config/config.exs

config :graphql, source_path: "web/graphql/**/*_schema.graphql"

Command line options

  • --force - forces compilation regardless of modification times

Summary

Functions

Returns GraphQL manifests

Callback implementation for c:Mix.Task.run/1

Functions

compile(schema_path, opts)
compile_all(schema_paths, opts)
extract_file_prefix(path)
manifests()

Returns GraphQL manifests.

run(args)

Specs

run(OptionParser.argv) :: :ok | :noop

Callback implementation for c:Mix.Task.run/1.