You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New composable macro architecture: three independent macros that can be used individually or together:
make_types! — generates Rust structs and enums from GraphQL type/input/enum definitions
make_operation! — generates the Operation enum, sub-enums (QueryField, MutationField, SubscriptionField), and the execute dispatch method
make_handlers! — generates a Handlers trait and DefaultHandlers struct as a customizable link between the Lambda runtime and the AppSync operations.
make_appsync! convenience macro: combines all three composable macros in a single invocation, recommended for the common single-Lambda-function use case
Handlers trait: generated trait with default implementations for appsync_handler, appsync_batch_handler (when batch = true), and service_fn. Users can override individual methods to customize handler behavior (authentication hooks, logging, etc.) while keeping defaults for the rest
default_traits option on make_types! / make_appsync!: controls whether the macro applies its default set of derive traits on a given type (default_traits = MyType: false)
derive option on make_types! / make_appsync!: adds extra derive macros on top of the defaults for a given type (derive = MyType: Default). Supports Default on enums (first variant becomes the default value)
type_module option on make_operation!: specifies the module path to types generated by make_types! in a different module or crate, as an alternative to bringing them all into scope
operation_type option on make_handlers!: specifies a custom path to the Operation type when it lives in a different module
error_logging option on make_operation! / make_appsync! (feature: log): controls whether the generated execute method logs errors via log::error! before converting them to an AppsyncResponse (default: true)
const fn index(self) -> usize on every generated enum type, enabling array indexing by enum variant
const fn all() on generated enums (changed from non-const to const)
data() and error() getters on AppsyncResponse
When the tracing feature is enabled, the default batch handler spawns each child task with a dedicated tracing::info_span!, linking per-operation spans to the parent invocation
Re-exports of lambda_runtime, serde, serde_json, and tokio as core dependencies (always available, not behind a feature flag)
Changed
Breaking: The crate no longer generates main(), log initialization, or AWS SDK client singletons. Users write their own main() and initialize these concerns directly. This is a deliberate design change: generating main() and instantiating SDK clients are application-level concerns that don't belong in a type-generation / operation-dispatch crate. The monolithic approach led to unsustainable option proliferation (every new logging framework or instrumentation pattern required another macro option and feature flag) and made it impossible to compose with external middleware such as Tower layers. See PR #12 for the full rationale
Breaking: Default features are now empty. env_logger is no longer enabled by default. Add features = ["env_logger"] to restore the previous behavior
Breaking: The hook, log_init, event_logging, only_appsync_types, exclude_appsync_types, only_appsync_operations, exclude_appsync_operations, only_lambda_handler, exclude_lambda_handler, and AWS SDK client definition options are no longer available in the default API. They remain available through appsync_lambda_main! behind the compat feature
Breaking: #[appsync_operation] now preserves the original function by default (it used to inline the body and remove the function). A new inline_and_remove parameter is available when you want the old behavior — the function body is inlined into the generated impl Operation method and the original function is removed. The keep_original_function_name parameter is moved behind the compat feature. Enabling compat also restores the old default behavior (inline and remove)
appsync_lambda_main! macro: moved behind the compat feature flag. It is refactored internally to delegate to the three composable macros. Prefer make_appsync! or the individual macros for new code
Fixed
Stopped using the GraphQL schema file path span in generated error diagnostics, which could produce confusing error locations