Try to use only backend, Its not a problem wither form query from frontend or backend, but if you form query from frontend:
- Then you need to pass this query from frontend to backend.
- And if you do this then your query is going to visible(network), any one can see how you fetch the data or format of query.
- Seurity issue occure.