[aws-appsync]: implementation for appsync::functionConfiguration for Pipeline Resolvers
See original GitHub issueCurrent implementation doesn’t offer customers a smooth ability to create AppSync Functions for Pipeline Resolvers.
Supersedes #6923
Use Case
If users want to utilize AppSync’s graphQL functions that are serializable and functionable.
Proposed Solution
Workaround currently would be to make Lambda Functions
but these are expensive and will costly for customers.
Possible solution could be to create an class that creates AppSync Functions
interface GraphQLFunctionProps {
dataSourceName: string,
description: string,
functionVersion: string,
name: string,
requestMappingTemplate?: MappingTemplate,
responseMappingTemplate?: MappingTemplate,
}
class GraphQLFunction extends Construct { ... }
class GraphQLApi extends Construct {
...
createGraphQLFunction(...);
...
}
Other
The Function
that can be added to the pipelineConfig
is not a Lambda Function
. Instead, it is AppSync::Function
.
See documentation on pipelineConfig
here.
See documentation on functionConfiguration
here.
See documentation on appsync:CreateFunction
here.
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Pipeline resolvers (VTL) - AWS AppSync
AWS AppSync executes resolvers on a GraphQL field. In some cases, applications require executing multiple operations to resolve a single GraphQL field.
Read more >Building AWS AppSync Pipeline Resolvers with ... - Medium
To demonstrate, we will implement the ListPosts resolver found in Nader Dabit's Intro to AWS AppSync Pipeline Functions:.
Read more >Pipeline resolvers in AppSync - Advanced Web Machinery
Pipeline resolvers. Recommended book. Building GraphQL APIs with AWS AppSync. How to design, implement, and deploy GraphQL-based APIs on the ...
Read more >How to Create Nested and Pipeline Resolvers with AppSync ...
If you want to learn AppSync in the best way possible check out the course I used to learn it all. Use code...
Read more >The anatomy of an AWS AppSync pipeline resolver
Introduction AWS AppSync is a fully managed service that allows developers to create and manage scalable APIs for their applications.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It isn’t a feature yet, but will be in the works soon!
You can use the L1 constructs, specifically
appsync.CfnFunctionConfiguration
.CfnFunctionConfigurationProps
So to create your appsync function it would look something like this:
Creating an AppSync Function
And adding it to a resolver would look like the following:
Creating a Pipeline Resolver
@mattiLeBlanc i wrote up a PR for pipeline functions #10111
Our design guidelines make it such that using the
IGraphqlApi
should be the reference because that way you can have multiple stacks. To be honest, I’m suprised to hear that the typescript is complaining… maybe we need an explicitimplements IGraphqlApi
at the end of the class declaration…Depends on what kind of resolver you want. In the #10111 PR, we make it so that all resolvers are under the API scope instead of the data source scope (which is more consistent with the architecture of AppSync). But generally I would say if you are making a unit resolver with a data source, it is easier to do
dataSouce.createResolver(...)
. And in the upcoming PR, you will be able to doapi.createResolver(...)
for convenience and to create pipeline resolvers easily!look into the Permissions section of the readme for roles and policies!