PalisadoesFoundation / talawa-api

API Backend for the Talawa Mobile App. Click on the link below to see our documentation
https://docs.talawa.io/
GNU General Public License v3.0
210 stars 719 forks source link

Feature Request: Using helper functions for queries #994

Closed kb-0311 closed 1 year ago

kb-0311 commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. The getSort() function is poorly reused where each file uses the same implementation of the function but it has been compy pasted multiple times.

Every other query has its own getSort() function with an almost identical implemntation. Describe the solution you'd like A clear and concise description of what you want to happen. I proposed the use of helper_function directory so that the function will have its own file and will be reused by everywhere it is defined. Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Approach to be followed (optional) A clear and concise description of approach to be followed. create src/reolvers/Query/helper_functions which will contain a getSort.ts file whichi will export the sorting implementation used by all the queries.The files with queries which are using this getSort function will then import this helper function and then appy when it is needed. Additional context Add any other context or screenshots about the feature request here.

kb-0311 commented 1 year ago

pls assign this to me