evaluate_code
¶
evaluate_code(
runtime: AppSyncRuntime,
code: Code,
context: Context,
*,
config_overrides: Optional[AppSyncClientConfig] = None,
function: Optional[String] = None,
) -> EvaluateCodeResponse
Evaluates the given code and returns the response. The code definition requirements depend on the specified runtime. For APPSYNC_JS runtimes, the code defines the request and response functions. The request function takes the incoming request after a GraphQL operation is parsed and converts it into a request configuration for the selected data source operation. The response function interprets responses from the data source and maps it to the shape of the GraphQL field output type.
Parameters:
-
runtime(AppSyncRuntime) –The runtime to be used when evaluating the code. Currently, only the
APPSYNC_JSruntime is supported. -
code(Code) –The code definition to be evaluated. Note that
codeandruntimeare both required for this action. Theruntimevalue must beAPPSYNC_JS. -
context(Context) –The map that holds all of the contextual information for your resolver invocation. A
contextis required for this action. -
function(Optional[String], default:None) –The function within the code to be evaluated. If provided, the valid values are
requestandresponse.
Raises:
-
AccessDeniedException–You don't have access to perform this operation on this resource.
-
BadRequestException–The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.
-
InternalFailureException–An internal AppSync error occurred. Try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.