w3-web-services
Purpose
Apollo Federation subgraph that provides email summaries, GitHub repository operations, and user profile data.
Architecture
- Apollo subgraph using
@apollo/server+@apollo/subgraph. - Loads config from AWS SSM Parameter Store then
.env. - Verifies Cognito JWTs when
Authorization: Bearer <token>is present. - MongoDB (
MONGODB_CONNECTION_STRING) stores user tokens and profile data. - SQS consumer reads signup events and creates users in MongoDB.
- Gmail: uses Google OAuth tokens + Gmail API; summarization uses Google GenAI.
- Microsoft: uses Microsoft Graph API for email list/detail and summary.
- GitHub: uses GitHub API to list repos/orgs and clones repos to
/tmp/github-reposforgit grepsearch.
GraphQL API
Queries:
summaryEmail(input: SummaryEmailInput): EmailSummaryResponse!(provider: gmail or microsoft)agentSummaryEmail(emailContent: String!): AgentSummaryEmailResponse!me(input: MeInput): UsergetGcpListEmail(limit: Int, pageToken: String): EmailListResponsegetGcpEmailDetail(input: GetGcpEmailDetailInput): EmailDetailgetMicrosoftListEmail(limit: Int, offset: Int): EmailListResponsegetMicrosoftEmailDetail(input: GetMicrosoftEmailDetailInput): EmailDetailgetUserRepositories: [GitHubRepository!]!getUserOrganizations: [GitHubOrganization!]!getOrganizationRepositories(input: GetOrganizationRepositoriesInput!): [GitHubRepository!]!searchInRepositories(input: SearchInRepositoriesInput!): SearchInRepositoriesResponse!
Mutations:
generateGcpAuthUrl: GenerateGcpAuthUrlResponsegenerateMicrosoftAuthUrl: GenerateMicrosoftAuthUrlResponsegenerateGithubAuthUrl: GenerateGithubAuthUrlResponserevokeGmailToken: RevokeTokenResponserevokeMicrosoftToken: RevokeTokenResponserevokeGithubToken: RevokeGithubTokenResponsesyncRepository(repoName: String!, branch: String): SyncRepositoryResponse!
Configuration highlights
AWS_REGION,COGNITO_USER_POOL_ID,COGNITO_CLIENT_IDMONGODB_CONNECTION_STRING,MONGODB_MAX_POOL_SIZESQS_SIGN_UP_HANDLER_QUEUEGITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,GITHUB_REDIRECT_URI