2 ms·
First, let's take these two propositions. > Say you have a web app, an iOS app and an android app and > let’s say the model of the data that makes sense for
by dventimihasura 4y ago
First, let's take these two propositions.
> Say you have a web app, an iOS app and an android app
and
> let’s say the model of the data that makes sense for the purposes being the UI for these apps is different from the model that’s used to persist data
Question: If we stipulate that the UI models are different from the persistent model, are the UI models are different from each other or are they they same? What I mean is this. Do the web app, iOS app, and android app models differ from each other? This is important for my reasoning that follows.
- andrewingram 4y agoGenerally no, they’re not different. For example, the consumer Twitter apps; or when I worked there, Depop. The situation may change if you also add internal tools to the mix, since they’re often operating on a superset of data that the consumer apps might have access to - though still not necessarily the same model as the persistence layer.
- dventimihasura 4y agoOk. Thanks for that clarification. In any case, your requirement can be satisfied by SQL views, which transform the persisted model (tables), and which are 'below' the GraphQL server.
- andrewingram 4y agoCan be, sure. But SQL, whilst very capable, isn’t the language I’d reach for in order to define my entire business logic layer. Sometimes these transforms are fairly involved and pull in things from multiple data sources and APIs, yes these can be done with advanced SQL wrangling, but at some point you’re just using the wrong tool for the job.