Skip to content
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

Add AWS AppSyncEvent #1939

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

PankajRawat333
Copy link

Issue #, if available:
#1938

Description of changes:

  • Added AWS AppSyncEvent to consume and process event directly on Lambda function.
  • Added unit tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashishdhingra
Copy link
Contributor

@PankajRawat333
Copy link
Author

@ashishdhingra I have updated type according to above link.

@ashishdhingra
Copy link
Contributor

@ashishdhingra I have updated type according to above link.

@PankajRawat333 Thanks for addressing comments for the PR. Discussed this PR with the team. @normj would have a high level look. Meanwhile, could you also please follow up with the Lambda team to get the schema details and data types for each field (since these are not documented in detail)? We would need to make sure to use the correct types for each field to avoid making any breaking changes in future for missed scenario.

@PankajRawat333
Copy link
Author

@ashishdhingra Received the AppSync schema from the internal group in the aws-powertool repository. All type information was accurate, but I renamed a few classes based on the schema.

@ashishdhingra
Copy link
Contributor

@ashishdhingra Received the AppSync schema from the internal group in the aws-powertool repository. All type information was accurate, but I renamed a few classes based on the schema.

@PankajRawat333 Provided some review comments. Also update test cases (and JSON file names) accordingly while addressing the review comments.

/// <summary>
/// Gets or sets the domain name associated with the request.
/// </summary>
public object DomainName { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be object or a string type?

/// <summary>
/// Gets or sets the variables passed to the GraphQL operation.
/// </summary>
public Dictionary<string, object> Variables { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per https://www.npmjs.com/package/@types/aws-lambda?activeTab=code, the data type for value is any. So we are good for it to be object.

/// <summary>
/// Gets or sets the domain name associated with the request.
/// </summary>
public object DomainName { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// <summary>
/// Represents the event payload received from AWS AppSync.
/// </summary>
public class AppSyncEvent<TArguments>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a Resolver event. Should we change the name to AppSyncResolverEvent<TArguments>? Refer:

We would also need to change documentation comment for this class, update Readme and it's example.

Is AppSyncAuthorizerEvent outside the scope for this PR for now?

/// <summary>
/// Represents Amazon Cognito User Pools authorization identity for AppSync
/// </summary>
public class AppSyncCognitoIdentity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants