-
Notifications
You must be signed in to change notification settings - Fork 821
feat(gen2-migration): add graphql lambda resolver migration support #14395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gen2-migration
Are you sure you want to change the base?
feat(gen2-migration): add graphql lambda resolver migration support #14395
Conversation
- Add AdditionalAuthProvider interface for AppSync auth configurations - Fetch additional auth providers from AWS console via AppSync API - Generate CDK escape hatches for additionalAuthenticationProviders - Integrate auth provider migration into data definition pipeline - Support API_KEY, AWS_IAM, OPENID_CONNECT, COGNITO_USER_POOLS, AWS_LAMBDA auth types
- Add extractFunctions method to DataDefinitionFetcher to scan @function directives - Add functions property support in data generator with TypeScript AST generation - Generate proper imports and function mappings for Gen2 defineData() - Support flexible @function directive parsing with various spacing/quote styles - Validate function existence in amplify-meta.json before migration
- Add @function directive detection in DataDefinitionFetcher - Generate function references in defineData() configuration - Extend AppFunctionsDefinitionFetcher to detect resolver functions - Map resolver functions to 'api' category for proper generation - Reuse shared getSchema() method to eliminate code duplication Enables complete Gen1→Gen2 migration of GraphQL Lambda resolvers including data resource references, function resource generation, and source code migration.
| @@ -1,10 +1,14 @@ | |||
| import assert from 'node:assert'; | |||
| import path from 'node:path'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| @@ -1,10 +1,14 @@ | |||
| import assert from 'node:assert'; | |||
| import path from 'node:path'; | |||
| import fs from 'node:fs/promises'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| import assert from 'node:assert'; | ||
| import path from 'node:path'; | ||
| import fs from 'node:fs/promises'; | ||
| import glob from 'glob'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| import { GetFunctionCommand, GetPolicyCommand, LambdaClient } from '@aws-sdk/client-lambda'; | ||
| import { DescribeRuleCommand, CloudWatchEventsClient } from '@aws-sdk/client-cloudwatch-events'; | ||
| import { StateManager } from '@aws-amplify/amplify-cli-core'; | ||
| import { StateManager, pathManager } from '@aws-amplify/amplify-cli-core'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
This PR adds support for migrating GraphQL Lambda resolvers (functions with
@functiondirectives) from Amplify Gen 1 to Gen 2. Previously, the migration tool only handled schema, table mappings, and auth modes but ignored Lambda function resolvers entirely.Example
Gen 1 GraphQL Schema:
Gen2 GraphQL Schema