|
|
|
|
|
by knlam
746 days ago
|
|
Working with GraphQL over 6 years, I have seen (and created) many mistakes mentioned in the article. GraphQL is not great but it has worked well for me, you just need to adapt & change mindset to create better interface for your graphQL endpoint. For example, having nested queries more than 2 levels is a no go for me (just like having nested inheritance is basically anti pattern) Focus more on your interface. One way to avoid N+1 and nested query is to required parameter for related fields. For example ``` user(id: $userId) { { id
friends {
id
...
}
```to ``` user(id: $userId) { id
friends(id: $userId) {
id
...
}
``` |
|