Skip to content

7. GraphQL Resolvers #8

@mrserverless

Description

@mrserverless
  • 7.1 Generate GraphQL code (go generate ./graphql)
  • 7.2 Implement graphql/resolver.go
    • Resolver struct with domain service fields
    • AccountService, TransactionService, BalanceService, ConsentService
    • NewResolver(services...) constructor
  • 7.3 Implement Query resolvers
    • Query.Account(ctx, id) - delegate to AccountService.RetrieveCurrentAccount
    • Query.Balance(ctx, accountID) - delegate to BalanceService.RetrieveAccountBalance
    • Query.Transactions(ctx, accountID, input) - delegate to TransactionService.RetrievePaymentTransactionHistory
    • Query.Consent(ctx, id) - delegate to ConsentService.RetrieveConsent
  • 7.4 Implement error handling
    • Map domain errors to GraphQL errors
    • Not found → user-facing error message
    • Internal errors → generic error message
  • 7.5 Implement input validation
    • Validate account IDs (not empty)
    • Validate date ranges (start before end)
    • Validate pagination (limit > 0)

Source: openspec/changes/bootstrap-mvp-foundation/tasks.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions