File tree Expand file tree Collapse file tree
lambda-appsync-proc/src/internal/make_appsync Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,7 +161,6 @@ impl ToTokens for MakeHandlers {
161161 event. info. operation. execute( event) . instrument(
162162 :: tracing:: info_span!(
163163 "AppsyncEvent" ,
164- "otel.name" =format!( "AppsyncEvent" ) ,
165164 ?operation
166165 )
167166 ) . await
Original file line number Diff line number Diff line change @@ -378,6 +378,34 @@ impl AppsyncResponse {
378378 pub fn unauthorized ( ) -> Self {
379379 AppsyncError :: new ( "Unauthorized" , "This operation cannot be authorized" ) . into ( )
380380 }
381+
382+ /// Returns a reference to the response data, if present
383+ ///
384+ /// # Examples
385+ ///
386+ /// ```
387+ /// # use lambda_appsync::AppsyncResponse;
388+ /// # use serde_json::json;
389+ /// let response = AppsyncResponse::from(json!({"user": "Alice"}));
390+ /// assert!(response.data().is_some());
391+ /// ```
392+ pub fn data ( & self ) -> Option < & Value > {
393+ self . data . as_ref ( )
394+ }
395+
396+ /// Returns a reference to the response error, if present
397+ ///
398+ /// # Examples
399+ ///
400+ /// ```
401+ /// # use lambda_appsync::{AppsyncResponse, AppsyncError};
402+ /// let error = AppsyncError::new("NotFound", "User not found");
403+ /// let response = AppsyncResponse::from(error);
404+ /// assert!(response.error().is_some());
405+ /// ```
406+ pub fn error ( & self ) -> Option < & AppsyncError > {
407+ self . error . as_ref ( )
408+ }
381409}
382410
383411impl From < Value > for AppsyncResponse {
You can’t perform that action at this time.
0 commit comments