Caravela.Gen.GraphQL (Caravela v0.10.0)

Copy Markdown View Source

Generates Absinthe types, queries, and mutations from a Caravela.Schema.Domain.

Produces three files, one per Absinthe schema area:

  • lib/<web>/schema/<context>_types.ex — object types
  • lib/<web>/schema/<context>_queries.ex — list/get queries
  • lib/<web>/schema/<context>_mutations.ex — create/update/delete

All three modules delegate to the context module generated by Caravela.Gen.Context, so authorization, hooks, and (when enabled) multi-tenant scoping flow through the Absinthe resolvers for free.

Tenant-injected fields are hidden from both the public object type and the input_object — tenant id comes from the Absinthe context map, not the client.

Returns a list of {path, source} tuples. The caller writes files. Files preserve content below the # --- CUSTOM --- marker on regeneration.

Summary

Functions

Render Absinthe types, queries, and mutations.

Render the Absinthe mutations file.

Render the Absinthe queries file.

Render the Absinthe types file.

Functions

render_all(domain, opts \\ [])

Render Absinthe types, queries, and mutations.

render_mutations(domain, opts \\ [])

Render the Absinthe mutations file.

render_queries(domain, opts \\ [])

Render the Absinthe queries file.

render_types(domain, opts \\ [])

Render the Absinthe types file.