Designing the application structure for social networking
In the previous chapter, this phase consisted of deciding which HTTP operations we needed to include in the application and how the server should react to the related requests. In the context of a GraphQL application, most of the time, we expose a single HTTP operation, POST
, at the /graphql
endpoint. This simplifies our job in this section; however, we should focus on how the data should look in our system, opening doors for future improvements, the object model, relationships between objects, the schema design, and the API design.
Object model
In GraphQL applications, the object model plays a critical role in defining how data is structured and accessed. This model defines the types of data in our system and how these types are interrelated. Based on the requirements outlined previously, we can design an object model for our SNP, NectMe. Here’s an overview of the key objects and their relationships.