v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1451205197.1 KB

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.

post/v1/apis/{apiId}/types/{typeName}/resolvers

Path parameters

apiIdstring required

The ID for the GraphQL API for which the resolver is being created.

typeNamestring required

The name of the <code>Type</code>.

Request body

fieldNamestring required

The name of the field to attach the resolver to.

dataSourceNamestring

The name of the data source for which the resolver is being created.

requestMappingTemplatestring
<p>The mapping template to use for requests.</p> <p>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).</p> <p>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.</p>
responseMappingTemplatestring

The mapping template to use for responses from the data source.

kind'UNIT' | 'PIPELINE'
<p>The resolver type.</p> <ul> <li> <p> <b>UNIT</b>: 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.</p> </li> <li> <p> <b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p> </li> </ul>
maxBatchSizeinteger

The maximum batching size for a resolver.

codestring

The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.

Response

Success