Solves [public]
14 subscribers
10 photos
21 links
Solves team public channel. https://solves.pro
Download Telegram
As the main approach to build an API in our company we use GraphQL.

To make it more comfortable for developing such backends we decided to use code-first approach.
Firstly, it helps us with type declarations. This is a major benefit in building typescript apps.
Secondly, it automaticly generates the schema and there is no need to synchronize it with DTOs every time we update our code base.
We use typeorm, and it fits great together with it.
We use @nestjs/graphql package and it was released because some people used to integrate type-graphql lib with nest apps.
Combining it with internal types, we write less extra code and even typeorm entities are decorated with stuff that graphql lib provides us.

We also face some common problems like N + 1 that is usually solved with dataloaders.
With these like "common" problems we managed to build a microservice template with GraphQL setup. So we can share some musts with you.

To make supporting the code base better, you should use abstractions. Get rid of the code that looks to occur many times.
For example, to make paginated responses, use generics and abstract classes that are returned dynamicly, based on function input that configures it.
Front end also comes with Apollo client and its features. Our front end is strictly typed that’s why we use GraphQL libraries that generate type declarations from the remote schema. With GraphQL it’s easy to specify api standards and to use contract with it. The client has many special things that will be described in the next post.

#graphql #nestjs
Hi, Everyone!
Today’s technical post about Nuxt, GraphQL, TypeScript bundle
In the next post we'll tell you why it's cool for the product and the customers. Enjoy reading)

In English
https://meteor-polyester-5d7.notion.site/EN-Nuxt-GraphQL-TypeScript-d1f0621fa89d42fe9d06a3fe23f9b423

In Russian
https://meteor-polyester-5d7.notion.site/RU-Nuxt-GraphQL-TypeScript-d4c4d23e32f44bc09e764b0b794a0bf4

#nuxt #graphql #typescript