/AWS1/CL_APY=>CREATERESOLVER()
¶
About CreateResolver¶
Creates a Resolver
object.
A resolver converts incoming requests into a format that a data source can understand, and converts the data source's responses into GraphQL.
Method Signature¶
IMPORTING¶
Required arguments:¶
IV_APIID
TYPE /AWS1/APYSTRING
/AWS1/APYSTRING
¶
The ID for the GraphQL API for which the resolver is being created.
IV_TYPENAME
TYPE /AWS1/APYRESOURCENAME
/AWS1/APYRESOURCENAME
¶
The name of the
Type
.
IV_FIELDNAME
TYPE /AWS1/APYRESOURCENAME
/AWS1/APYRESOURCENAME
¶
The name of the field to attach the resolver to.
Optional arguments:¶
IV_DATASOURCENAME
TYPE /AWS1/APYRESOURCENAME
/AWS1/APYRESOURCENAME
¶
The name of the data source for which the resolver is being created.
IV_REQUESTMAPPINGTEMPLATE
TYPE /AWS1/APYMAPPINGTEMPLATE
/AWS1/APYMAPPINGTEMPLATE
¶
The mapping template to use for requests.
A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).
VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.
IV_RESPONSEMAPPINGTEMPLATE
TYPE /AWS1/APYMAPPINGTEMPLATE
/AWS1/APYMAPPINGTEMPLATE
¶
The mapping template to use for responses from the data source.
IV_KIND
TYPE /AWS1/APYRESOLVERKIND
/AWS1/APYRESOLVERKIND
¶
The resolver type.
UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of
Function
objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
IO_PIPELINECONFIG
TYPE REF TO /AWS1/CL_APYPIPELINECONFIG
/AWS1/CL_APYPIPELINECONFIG
¶
The
PipelineConfig
.
IO_SYNCCONFIG
TYPE REF TO /AWS1/CL_APYSYNCCONFIG
/AWS1/CL_APYSYNCCONFIG
¶
The
SyncConfig
for a resolver attached to a versioned data source.
IO_CACHINGCONFIG
TYPE REF TO /AWS1/CL_APYCACHINGCONFIG
/AWS1/CL_APYCACHINGCONFIG
¶
The caching configuration for the resolver.
IV_MAXBATCHSIZE
TYPE /AWS1/APYMAXBATCHSIZE
/AWS1/APYMAXBATCHSIZE
¶
The maximum batching size for a resolver.
IO_RUNTIME
TYPE REF TO /AWS1/CL_APYAPPSYNCRUNTIME
/AWS1/CL_APYAPPSYNCRUNTIME
¶
runtime
IV_CODE
TYPE /AWS1/APYCODE
/AWS1/APYCODE
¶
The
resolver
code that contains the request and response functions. When code is used, theruntime
is required. Theruntime
value must beAPPSYNC_JS
.
IV_METRICSCONFIG
TYPE /AWS1/APYRESOLVERLEVELMETCFG
/AWS1/APYRESOLVERLEVELMETCFG
¶
Enables or disables enhanced resolver metrics for specified resolvers. Note that
metricsConfig
won't be used unless theresolverLevelMetricsBehavior
value is set toPER_RESOLVER_METRICS
. If theresolverLevelMetricsBehavior
is set toFULL_REQUEST_RESOLVER_METRICS
instead,metricsConfig
will be ignored. However, you can still set its value.
metricsConfig
can beENABLED
orDISABLED
.