Back to feed
Dev.to
Dev.to
6/26/2026
Protect APIs from over-fetching/under-fetching - REST vs GraphQL in .NET core

Protect APIs from over-fetching/under-fetching - REST vs GraphQL in .NET core

Short summary

REST and GraphQL each solve API fetching problems in different ways for .NET applications. REST uses projections to select only needed fields, preventing over-fetching and delivering better performance for high-throughput scenarios. GraphQL lets clients request exactly what they need, eliminating under-fetching. Choose REST for stable internal APIs; use GraphQL when consuming clients have diverse data needs.

  • REST excels at simplicity and performance; GraphQL at flexibility and reducing network round-trips
  • EF Core projections prevent over-fetching by selecting only needed fields at the database level
  • REST for stable contracts and 10M+ throughput; GraphQL for complex UIs with varying client needs

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more