Company
Date Published
Author
Mikhail Novikov
Word count
865
Language
English
Hacker News points
None

Summary

Gatsby has introduced a new schema customization API in version 2.2.0, aimed at enhancing and stabilizing its GraphQL layer by allowing developers to define, fix, and extend types within their Gatsby GraphQL schemas. This update addresses previous issues where automatic schema generation could lead to unexpected changes and bugs, providing two new APIs, `createTypes` and `createResolvers`, that offer more controlled customization options. The `createTypes` API allows explicit type definitions, ensuring stable type names, while `createResolvers` facilitates further customization, including adding fields to existing types. Additionally, Gatsby introduced the Type Builder API, combining the simplicity of Schema Definition Language with the flexibility of graphql-js, to streamline type creation with resolvers. Despite efforts to avoid breaking changes, some modifications, such as stable type naming, may require developers to update fragments referring to old type names. These enhancements promise a more robust and customizable GraphQL experience, paving the way for further developments like theming, and have been met with positive feedback from the community.