You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Fetch API | 0 KB (Browser built-in) | Low | None (Native API) | High | No additional dependency, widely supported |
960
-
961
-
(\*) Bundle sizes are approximate and may vary based on version and configuration. Values are culled from bundlephobia.com where available.
962
-
963
-
### Notes:
964
-
965
-
- **Apollo Angular**: Offers the most comprehensive feature set but comes with a larger bundle size and steeper learning curve.
966
-
- **Urql**: Provides a good balance between features and bundle size, with a focus on simplicity.
967
-
- **GraphQL-Request**: Minimal client ideal for simple use cases where advanced features aren't needed.
968
-
- **Axios**: Not a GraphQL-specific solution, but familiar to many developers and versatile for various HTTP requests.
969
-
- **Fetch API**: Native browser API, no additional bundle size, but requires more manual work for GraphQL operations.
970
-
971
-
This table should help developers choose the right method based on their specific project needs, considering factors like bundle size, learning curve, caching capabilities, community support, and additional features.
953
+
| Method | Bundle Size (minified + gzip)\* | Learning Curve | Caching Capabilities | Community Support | Additional Features |
| Fetch API | 0 KB (Browser built-in) | Low | None (Native API) | High | No additional dependency, widely supported |
960
+
961
+
(\*) Bundle sizes are based on bundlejs.com calculations using the provided export statements, with minification and gzip compression applied.
962
+
963
+
**Notes:**
964
+
965
+
1. Apollo Angular's bundle size (258 KB gzipped) is significantly larger than other options, which may impact initial load timesfor applications.
966
+
2. Urql offers a much smaller bundle size (17 KB gzipped) while still providing both document caching and normalized caching through its plugin architecture.
967
+
3. GraphQL-Request, despite being a minimal client, has a larger bundle size (58.6 KB gzipped) than expected, which might be due to including the full GraphQL parser.
968
+
4. Axios, a general-purpose HTTP client, has a moderate bundle size (24 KB gzipped) considering its feature set.
969
+
5. The Fetch API remains the lightest option as it's built into modern browsers, but it lacks some conveniences provided by other libraries.
970
+
6. Bundle sizes for critical path libraries can significantly impact performance. Consider lazy-loading or code-splitting strategies when using larger libraries like Apollo Angular.
971
+
972
+
**Bundle Size References:**
973
+
974
+
1. Apollo Angular: [bundlejs.com link](https://bundlejs.com/?q=apollo-angular%2Capollo-angular%2Fhttp%2C%40apollo%2Fclient%2Fcore&treeshake=%5B%7B+APOLLO_OPTIONS%2CApolloModule+%7D%5D%2C%5B%7B+HttpLink+%7D%5D%2C%5B%7B+InMemoryCache+%7D%5D)
Copy file name to clipboardExpand all lines: blog/graphql-schema-2024-07-11.md
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Design a GraphQL Schema So Good, It'll Make REST APIs Cry
2
+
title: Design a GraphQL Schema So Good, It'll Make REST APIs Cry - Part 1
3
3
authors:
4
4
- name: Amit Singh
5
5
title: Head of Growth and Strategy @ Tailcall
@@ -16,8 +16,18 @@ slug: graphql-schema
16
16
17
17
Designing a robust, scalable GraphQL schema is critical for building production-ready APIs that can evolve with your application's needs. In this comprehensive guide, we'll walk through the process of crafting a GraphQL schema for a real-world application, highlighting best practices and considerations along the way.
18
18
19
+
If you are thinking how we could possibly cover all of the lovely intricacies associated with this topic in one go, you are right, we can't and so we are not! We have created an amazing series to take you through the nuances of working with GraphQL schemas.
20
+
21
+
Let's break our job into puzzle pieces. Let's start by simply creating designing a brand new schema!
22
+
19
23
<!-- truncate -->
20
24
25
+
<divstyle={{textAlign:'center',margin:'16px'}}>
26
+
27
+
<img src="/images/blog/puzzle-graphql-schema-1.png" alt="puzzle piece to visualise the series" style={{maxWidth: '40%'}} />
28
+
29
+
</div>
30
+
21
31
If you're new to GraphQL Schema, check out our [GraphQL Schema Tutorial](https://tailcall.run/graphql/schemas-and-types/) to get up to speed with the basics.
22
32
23
33
## The Power of GraphQL Schemas
@@ -474,3 +484,9 @@ Remember, your schema is a living document. As your application evolves, so too
474
484
The TechTalent example we've explored here demonstrates many real-world considerations, but every application will have its unique requirements. Always design with your specific use cases in mind, and don't be afraid to iterate as you learn more about how your API is used in practice.
475
485
476
486
By investing time in thoughtful schema design upfront, you'll create a solid foundation for your GraphQL API, enabling efficient development and a great experience for your API consumers.
487
+
488
+
Alright greatttt! You have successfully completed the first part of a very intricate series!! Pat yourslef and maybe high five your cat! Here are the links to the next blogs in the series that have already been published.
489
+
490
+

0 commit comments