| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.AppSync.EvaluateCode
Description
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.
Synopsis
- data EvaluateCode = EvaluateCode' {}
- newEvaluateCode :: AppSyncRuntime -> Text -> Text -> EvaluateCode
- evaluateCode_function :: Lens' EvaluateCode (Maybe Text)
- evaluateCode_runtime :: Lens' EvaluateCode AppSyncRuntime
- evaluateCode_code :: Lens' EvaluateCode Text
- evaluateCode_context :: Lens' EvaluateCode Text
- data EvaluateCodeResponse = EvaluateCodeResponse' {
- error :: Maybe EvaluateCodeErrorDetail
- evaluationResult :: Maybe Text
- logs :: Maybe [Text]
- httpStatus :: Int
- newEvaluateCodeResponse :: Int -> EvaluateCodeResponse
- evaluateCodeResponse_error :: Lens' EvaluateCodeResponse (Maybe EvaluateCodeErrorDetail)
- evaluateCodeResponse_evaluationResult :: Lens' EvaluateCodeResponse (Maybe Text)
- evaluateCodeResponse_logs :: Lens' EvaluateCodeResponse (Maybe [Text])
- evaluateCodeResponse_httpStatus :: Lens' EvaluateCodeResponse Int
Creating a Request
data EvaluateCode Source #
See: newEvaluateCode smart constructor.
Constructors
| EvaluateCode' | |
Fields
| |
Instances
Arguments
| :: AppSyncRuntime | |
| -> Text | |
| -> Text | |
| -> EvaluateCode |
Create a value of EvaluateCode with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:function:EvaluateCode', evaluateCode_function - The function within the code to be evaluated. If provided, the valid
values are request and response.
EvaluateCode, evaluateCode_runtime - The runtime to be used when evaluating the code. Currently, only the
APPSYNC_JS runtime is supported.
EvaluateCode, evaluateCode_code - The code definition to be evaluated. Note that code and runtime are
both required for this action. The runtime value must be APPSYNC_JS.
$sel:context:EvaluateCode', evaluateCode_context - The map that holds all of the contextual information for your resolver
invocation. A context is required for this action.
Request Lenses
evaluateCode_function :: Lens' EvaluateCode (Maybe Text) Source #
The function within the code to be evaluated. If provided, the valid
values are request and response.
evaluateCode_runtime :: Lens' EvaluateCode AppSyncRuntime Source #
The runtime to be used when evaluating the code. Currently, only the
APPSYNC_JS runtime is supported.
evaluateCode_code :: Lens' EvaluateCode Text Source #
The code definition to be evaluated. Note that code and runtime are
both required for this action. The runtime value must be APPSYNC_JS.
evaluateCode_context :: Lens' EvaluateCode Text Source #
The map that holds all of the contextual information for your resolver
invocation. A context is required for this action.
Destructuring the Response
data EvaluateCodeResponse Source #
See: newEvaluateCodeResponse smart constructor.
Constructors
| EvaluateCodeResponse' | |
Fields
| |
Instances
newEvaluateCodeResponse Source #
Arguments
| :: Int | |
| -> EvaluateCodeResponse |
Create a value of EvaluateCodeResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:error:EvaluateCodeResponse', evaluateCodeResponse_error - Contains the payload of the response error.
$sel:evaluationResult:EvaluateCodeResponse', evaluateCodeResponse_evaluationResult - The result of the evaluation operation.
$sel:logs:EvaluateCodeResponse', evaluateCodeResponse_logs - A list of logs that were generated by calls to util.log.info and
util.log.error in the evaluated code.
$sel:httpStatus:EvaluateCodeResponse', evaluateCodeResponse_httpStatus - The response's http status code.
Response Lenses
evaluateCodeResponse_error :: Lens' EvaluateCodeResponse (Maybe EvaluateCodeErrorDetail) Source #
Contains the payload of the response error.
evaluateCodeResponse_evaluationResult :: Lens' EvaluateCodeResponse (Maybe Text) Source #
The result of the evaluation operation.
evaluateCodeResponse_logs :: Lens' EvaluateCodeResponse (Maybe [Text]) Source #
A list of logs that were generated by calls to util.log.info and
util.log.error in the evaluated code.
evaluateCodeResponse_httpStatus :: Lens' EvaluateCodeResponse Int Source #
The response's http status code.