Skip to main content

Crate lambda_appsync_proc

Crate lambda_appsync_proc 

Source
Expand description

Procedural macros for the lambda-appsync type-safe AWS AppSync resolver framework.

This crate is not intended for direct use. Depend on lambda-appsync instead — it re-exports all macros from this crate under a stable, unified API.

§Provided Macros

MacroKindPurpose
make_appsync!function-likeGenerate the full AppSync resolver scaffolding from a GraphQL schema
make_handlers!function-likeGenerate handler dispatch glue for a set of operations
make_operation!function-likeGenerate a single typed operation from a GraphQL field definition
make_types!function-likeGenerate Rust types from GraphQL type definitions
appsync_operationattributeAnnotate an async handler function as an AppSync operation resolver
appsync_lambda_main!function-like(feature: compat) Generate a main entry point compatible with the legacy single-resolver pattern

Each macro has detailed documentation on its own page, including syntax, options, and examples.

§Feature Flags

  • compat — Enables appsync_lambda_main! for backwards-compatible single-resolver Lambda entry points
  • log — Enables log-based logging support in generated code
  • env_logger — Enables env_logger initialisation in generated entry points
  • tracing — Enables tracing-based instrumentation in generated code

Macros§

appsync_lambda_main
Generates the code required to handle AWS AppSync Direct Lambda resolver events based on a GraphQL schema.
make_appsync
Convenience macro that combines make_types!, make_operation!, and make_handlers! into a single invocation.
make_handlers
Generates a Handlers trait and a DefaultHandlers struct for handling AWS AppSync Lambda events.
make_operation
Generates the Operation enum and its dispatch logic from a GraphQL schema file.
make_types
Generates Rust types (structs and enums) from a GraphQL schema file.

Attribute Macros§

appsync_operation
Marks an async function as an AWS AppSync resolver operation, binding it to a specific Query, Mutation or Subscription operation defined in the GraphQL schema.