TL;DR
Strapi v3.0.0-beta.17.3 brings several enhancements to GraphQL policies, fixes relation handling, and improves documentation. The update makes ctx.params and ctx.query available to GraphQL policies, fixes many-to-many relation handling, adds schema improvements, and allows empty default values for group attributes.
Highlight of the Release
- Added
ctx.params and ctx.query access to GraphQL policies
- Fixed handling of many-to-many relations in GraphQL queries
- Added
resolverOf and plugin keys to GraphQL schema
- Fixed issue with removing default values for number type fields in groups
- Updated Italian translations
Migration Guide
No migration is required for this release. The changes are backward compatible and should work seamlessly with existing Strapi applications running v3.0.0-beta.17.2.
Upgrade Recommendations
This release contains important bug fixes and enhancements for GraphQL functionality. We recommend all users, especially those using GraphQL APIs with policies or many-to-many relations, to upgrade to this version.
The upgrade process should be straightforward:
npm install [email protected]
# or
yarn upgrade [email protected]
After upgrading, restart your Strapi application to apply the changes.
Bug Fixes
GraphQL Many-to-Many Relation Fix
Fixed an issue where many-to-many relations were being loaded unnecessarily when they were already populated. The system now checks if a many-to-many relation is already populated before attempting to load it, improving performance and preventing potential data inconsistencies.
Group Attributes Default Value Fix
Resolved issue #4138 where users couldn't remove default values for number type fields in groups. This fix now allows setting empty default values for group attributes, providing more flexibility when defining content types.
Documentation Improvements
Several typos and grammatical errors were corrected in the documentation:
- Fixed "flies" to "files"
- Fixed "constomization" to "customization"
- Various other minor grammatical improvements
New Features
GraphQL Policy Context Enhancement
GraphQL policies now have access to ctx.params and ctx.query, allowing developers to create more sophisticated and context-aware authorization rules. This enhancement brings GraphQL policy capabilities closer to REST API policies, enabling consistent authorization logic across different API types.
GraphQL Schema Improvements
The GraphQL schema has been enhanced with the addition of resolverOf and plugin keys, providing better metadata about resolvers and their associated plugins. This improvement helps with debugging and understanding the GraphQL schema structure.
Security Updates
No specific security fixes were included in this release.
Performance Improvements
GraphQL Query Optimization
The fix for many-to-many relation handling improves performance by preventing unnecessary database queries when relations are already populated. This optimization is particularly beneficial for complex GraphQL queries that involve multiple related entities.
Impact Summary
This release focuses on improving GraphQL functionality and fixing several bugs. The most significant changes include making context parameters available to GraphQL policies, fixing many-to-many relation handling, and resolving issues with group attribute default values.
For developers using GraphQL with Strapi, this update provides more powerful policy capabilities and better performance with relation handling. Content managers will benefit from the fix allowing empty default values for number fields in groups.
The changes are non-breaking and should improve the overall stability and functionality of Strapi, particularly for projects heavily utilizing GraphQL APIs.
Full Release Notes
💅 Enhancement
🐛 Bug fix