amazonka-appsync-2.0: Amazon AppSync SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Creating a Request

data EvaluateCode Source #

See: newEvaluateCode smart constructor.

Constructors

EvaluateCode' 

Fields

  • function :: Maybe Text

    The function within the code to be evaluated. If provided, the valid values are request and response.

  • runtime :: AppSyncRuntime

    The runtime to be used when evaluating the code. Currently, only the APPSYNC_JS runtime is supported.

  • code :: Text

    The code definition to be evaluated. Note that code and runtime are both required for this action. The runtime value must be APPSYNC_JS.

  • context :: Text

    The map that holds all of the contextual information for your resolver invocation. A context is required for this action.

Instances

Instances details
ToJSON EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

ToHeaders EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

ToPath EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

ToQuery EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

AWSRequest EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Associated Types

type AWSResponse EvaluateCode #

Generic EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Associated Types

type Rep EvaluateCode :: Type -> Type #

Read EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Show EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

NFData EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Methods

rnf :: EvaluateCode -> () #

Eq EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Hashable EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

type AWSResponse EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

type Rep EvaluateCode Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

type Rep EvaluateCode = D1 ('MetaData "EvaluateCode" "Amazonka.AppSync.EvaluateCode" "amazonka-appsync-2.0-4Pb6UqteLv1I9NIWaj90bg" 'False) (C1 ('MetaCons "EvaluateCode'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "function") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "runtime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AppSyncRuntime)) :*: (S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "context") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newEvaluateCode Source #

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

Instances details
Generic EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Associated Types

type Rep EvaluateCodeResponse :: Type -> Type #

Read EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Show EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

NFData EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

Methods

rnf :: EvaluateCodeResponse -> () #

Eq EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

type Rep EvaluateCodeResponse Source # 
Instance details

Defined in Amazonka.AppSync.EvaluateCode

type Rep EvaluateCodeResponse = D1 ('MetaData "EvaluateCodeResponse" "Amazonka.AppSync.EvaluateCode" "amazonka-appsync-2.0-4Pb6UqteLv1I9NIWaj90bg" 'False) (C1 ('MetaCons "EvaluateCodeResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EvaluateCodeErrorDetail)) :*: S1 ('MetaSel ('Just "evaluationResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "logs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newEvaluateCodeResponse Source #

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_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.