I am considering refactoring my frontend's(Angular) direct interaction with a Go-based Payment Serice (Forms some small service am using for my Dango backend) . The main backend is Django based . I intend to do this by implementing a proxy view in my Django to directly call the service . The goal is to centralize API calls and handle authentication, request formatting, and error management within the Django backend. I am evaluating whether to implement a custom Django proxy view or use Graphene for a GraphQL-based solution, or explore other potential frameworks or libraries that might simplify and optimize this interaction. The solution should reduce complexity on the frontend, improve security by managing tokens server-side, and provide a consistent API interface.I have like 40 queries and mutations in the FE , meaning if I was going to assign them individual action , that will mean an increased API surface area. I am asking if anyone has faced a similar challenge and which solutions did you go for .
Here is a sample look of one of my queries:
import { gql } from 'apollo-angular';
/** query PAYMENT_HISTORY */
const PAYMENT_HISTORY = gql`
query paymentHistory($userId: String!) {
paymentHistory(userId: $userId) {
transactions {
id
amount
date
status
description
}
totalCount
}