DEV Community

Discussion on: What's the difference between Front-end and Back-end development?

ricobrase profile image
Rico Brase

Why would this be of any relevance for my idea of backend and frontend developers?

It literally does not matter if the frontend dev writes GQL queries theirself or get them by a backend dev.
Ideally, the frontend dev should be familiar with the interfacing technology used - whether it's GQL, REST, or something else. It's their job to gather the data provided by the backend.

Thread Thread
aarone4 profile image
Aaron Reese

I think it is critical as to where the line is drawn between FE and BE which is why I asked the question. Would you expect your FE developer to be able to structure a complex query to fetch the required data efficiently, or would you expect the BE Dev to develop the data Map that the FE then renders
For a concrete example.... Although I was doing both BE and FE on this project I had data that was in 4 dimensions: style, size, colour, location. Do I take the computational hit and create nested JSON of all attributes which makes presentation easier (equivalent to a noSQL document model) and if so so I so size in colour or colour in size, or just use object keys and dynamically map the data from the arrays using their keys (more like a RDBMS model) the latter is more flexible but requires run time overhead. The former is probably more responsive but with a larger time to first interaction and only optimised for one access pattern.
Personally I would only expect a Senior Dev to be able to make that call and in reality it is more likely to fall to the BE dev to structure the data as required for consumption by the FE. Not saying that is right, just practical reality. And if that is the case should the multi -level JSON object be created at the database or API level where there is likely to be more processing power and the ability to cache the model.