Compile-time GraphQL client for Elixir using Ecto embedded schemas.
Run mix precommit before every commit. It runs:
compile --warnings-as-errorsdeps.unlock --unusedformatcredo --strictdialyzertest
Do not commit if mix precommit fails. Fix all issues first.
- Use
typed_structorfor internal data structs (AST, schema types) - Use
ecto_typed_schema(embedded schemas) for generated GraphQL types - Use
Ecto.Typefor custom scalar and enum serialization - Use
mimicfor mocking in tests - Never use
any()orterm()in typespecs unless the value is genuinely unconstrained - Always use parentheses in
@typedefinitions:@type foo() :: bar(), not@type foo :: bar - Function ordering: public functions above private. If a private function is only used by one public function, place it directly below that public function. In test files, private helpers go below test cases.
- Unused variables must have meaningful names:
_modulenot_,_restnot_. The prefix_marks it unused; the name documents what it is - Prefer
TypedGql.Parser+ AST traversal over regex for extracting information from GraphQL strings. Regex is fragile (comments, string literals, keywords likeon). Reserve regex for non-GraphQL text processing only (e.g., line splitting in the lexer) - Credo disables: never disable credo at file level or for an entire rule. Only use inline disables (
credo:disable-for-next-lineorcredo:disable-for-lines:N) with a reason comment on the line above explaining why - Run
/simplifybefore every commit to review code for reuse, quality, and efficiency - Semantic commit messages:
feat:,fix:,chore:,refactor:,test:,docs: - Small commits: one logical change per commit, not multiple unrelated changes bundled together
- Submit changes as PRs, not direct commits to main
- PR title goes into changelog: must be descriptive, specific, and reflect the main change (e.g., "fix: handle network errors in execute/3" not "fix: various fixes")
nimble_parsec— lexer (compile-time only)ecto+ecto_typed_schema— embedded schemas, changesets, type systemtyped_structor— internal struct definitions with auto typespecsreq— HTTP client for runtime query executionjason— JSON encoding/decodingmimic— test mockingcredo— static analysisdialyxir— dialyzer integration