qiusuo-fuyuan / qiusuo-backend

0 stars 0 forks source link

All - Generate Encoding The Primary Key Using Base64 For GraphQL ID #89

Open ryan-zheng-teki opened 3 years ago

ryan-zheng-teki commented 3 years ago

User Story currently we send the primary key number directly to frontend for the models. However, the primary key should not be shown to users. We have to generate a hashed code to frontend. When we receive the hashedCode, we convert it into the id again.

How To Do Create a BaseResover. This BaseResolver will have a id function. In this function we will use base64 encoding/decoding algorithm to encode the primary key with the type to generate a unique id.