Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
Synopsis
- data CreateResolver = CreateResolver' {}
- newCreateResolver :: Text -> Text -> Text -> CreateResolver
- createResolver_dataSourceName :: Lens' CreateResolver (Maybe Text)
- createResolver_requestMappingTemplate :: Lens' CreateResolver (Maybe Text)
- createResolver_kind :: Lens' CreateResolver (Maybe ResolverKind)
- createResolver_cachingConfig :: Lens' CreateResolver (Maybe CachingConfig)
- createResolver_responseMappingTemplate :: Lens' CreateResolver (Maybe Text)
- createResolver_syncConfig :: Lens' CreateResolver (Maybe SyncConfig)
- createResolver_pipelineConfig :: Lens' CreateResolver (Maybe PipelineConfig)
- createResolver_apiId :: Lens' CreateResolver Text
- createResolver_typeName :: Lens' CreateResolver Text
- createResolver_fieldName :: Lens' CreateResolver Text
- data CreateResolverResponse = CreateResolverResponse' {
- resolver :: Maybe Resolver
- httpStatus :: Int
- newCreateResolverResponse :: Int -> CreateResolverResponse
- createResolverResponse_resolver :: Lens' CreateResolverResponse (Maybe Resolver)
- createResolverResponse_httpStatus :: Lens' CreateResolverResponse Int
Creating a Request
data CreateResolver Source #
See: newCreateResolver
smart constructor.
CreateResolver' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> CreateResolver |
Create a value of CreateResolver
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:dataSourceName:CreateResolver'
, createResolver_dataSourceName
- The name of the data source for which the resolver is being created.
$sel:requestMappingTemplate:CreateResolver'
, createResolver_requestMappingTemplate
- The mapping template to be used 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 a Lambda data source. For all other data sources, VTL request and response mapping templates are required.
$sel:kind:CreateResolver'
, createResolver_kind
- The resolver type.
- UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. A UNIT resolver enables you to execute a GraphQL query against a single data source.
- PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables
you to execute a series of
Function
in a serial manner. You can use a pipeline resolver to execute a GraphQL query against multiple data sources.
$sel:cachingConfig:CreateResolver'
, createResolver_cachingConfig
- The caching configuration for the resolver.
$sel:responseMappingTemplate:CreateResolver'
, createResolver_responseMappingTemplate
- The mapping template to be used for responses from the data source.
$sel:syncConfig:CreateResolver'
, createResolver_syncConfig
- The SyncConfig
for a resolver attached to a versioned datasource.
$sel:pipelineConfig:CreateResolver'
, createResolver_pipelineConfig
- The PipelineConfig
.
$sel:apiId:CreateResolver'
, createResolver_apiId
- The ID for the GraphQL API for which the resolver is being created.
$sel:typeName:CreateResolver'
, createResolver_typeName
- The name of the Type
.
$sel:fieldName:CreateResolver'
, createResolver_fieldName
- The name of the field to attach the resolver to.
Request Lenses
createResolver_dataSourceName :: Lens' CreateResolver (Maybe Text) Source #
The name of the data source for which the resolver is being created.
createResolver_requestMappingTemplate :: Lens' CreateResolver (Maybe Text) Source #
The mapping template to be used 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 a Lambda data source. For all other data sources, VTL request and response mapping templates are required.
createResolver_kind :: Lens' CreateResolver (Maybe ResolverKind) Source #
The resolver type.
- UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. A UNIT resolver enables you to execute a GraphQL query against a single data source.
- PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables
you to execute a series of
Function
in a serial manner. You can use a pipeline resolver to execute a GraphQL query against multiple data sources.
createResolver_cachingConfig :: Lens' CreateResolver (Maybe CachingConfig) Source #
The caching configuration for the resolver.
createResolver_responseMappingTemplate :: Lens' CreateResolver (Maybe Text) Source #
The mapping template to be used for responses from the data source.
createResolver_syncConfig :: Lens' CreateResolver (Maybe SyncConfig) Source #
The SyncConfig
for a resolver attached to a versioned datasource.
createResolver_pipelineConfig :: Lens' CreateResolver (Maybe PipelineConfig) Source #
The PipelineConfig
.
createResolver_apiId :: Lens' CreateResolver Text Source #
The ID for the GraphQL API for which the resolver is being created.
createResolver_typeName :: Lens' CreateResolver Text Source #
The name of the Type
.
createResolver_fieldName :: Lens' CreateResolver Text Source #
The name of the field to attach the resolver to.
Destructuring the Response
data CreateResolverResponse Source #
See: newCreateResolverResponse
smart constructor.
CreateResolverResponse' | |
|
Instances
newCreateResolverResponse Source #
Create a value of CreateResolverResponse
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:resolver:CreateResolverResponse'
, createResolverResponse_resolver
- The Resolver
object.
$sel:httpStatus:CreateResolverResponse'
, createResolverResponse_httpStatus
- The response's http status code.
Response Lenses
createResolverResponse_resolver :: Lens' CreateResolverResponse (Maybe Resolver) Source #
The Resolver
object.
createResolverResponse_httpStatus :: Lens' CreateResolverResponse Int Source #
The response's http status code.