DEV Community

Discussion on: Achieving Causal Consistency in your GraphQL API using NestJS with MongoDB Server Sessions

Collapse
 
nickylenaers profile image
Nicky Lenaers

Yes, I use the interfaces folder to store interfaces that can be used across the API. The dto folder stores the specific GraphQL classes implementing those interfaces.

Regarding @pizza-api, this simply refers to some place in the API for demonstration purposes. I usually put a path in my tsconfig.json file to make these imports possible. So for example:

apps/pizza-order/tsconfig.json

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "types": ["node", "jest"],
    "paths": {
      "@pizza-api/user/*": ["apps/pizza-order/src/app/user/*"],
      // Other paths...
    }
  },
  "include": ["**/*.ts"]
}