feat: Enhance MikroORM Integration#287
Merged
xcfox merged 10 commits intomodevol-com:mainfrom Feb 7, 2026
Merged
Conversation
- Integrated `provideWeaverContext` into the `fields` method of `MikroInputFactory` to improve context handling. - Updated field definitions to utilize the inherited context, ensuring better type resolution and consistency in GraphQL object types.
- Added custom input validation capabilities to the MikroInputFactory, allowing for field-specific validation rules during create, insert, update, and upsert operations. - Implemented methods to compile data validators for both single and array inputs, ensuring robust validation and error handling. - Updated tests to verify the functionality of custom input validation across various mutation scenarios.
…tory - Removed the operation parameter from the validateFields method, streamlining the validation process for both create and update operations. - Updated calls to validateFields to reflect the removal of the operation parameter, enhancing code clarity and maintainability.
- Enhanced the validateFields method to perform field validation in parallel, improving performance. - Updated the compileArrayDataValidator method to validate array elements concurrently, ensuring faster processing of input data. - Adjusted error handling to maintain clarity in validation results while preserving existing functionality.
…e/update operations - Enhanced MikroInputFactory to accept GraphQLInputType and GraphQLOutputType in property behaviors for create and update operations, allowing direct use of GraphQL types without validation. - Introduced a type guard to identify GraphQL types in the configuration. - Updated tests to verify the correct handling of GraphQL types in input generation for both create and update scenarios, ensuring expected behavior in the generated GraphQL schemas.
…andling - Introduced a compileValidator method in MikroWeaver to generate validation functions from entity configurations, improving input validation capabilities. - Enhanced getFieldConfigs to cache and retrieve field configurations, supporting GraphQLSilk and GraphQL types. - Updated MikroInputFactory to utilize the new validation and configuration methods, ensuring robust handling of entity fields. - Added tests to verify the correct behavior of field validation and configuration retrieval in various scenarios.
…or GraphQL types - Added a `dialect` option to `MikroWeaverConfigOptions` to specify the database dialect, influencing available comparison operators. - Updated `MikroInputFactory` to dynamically generate comparison operator types based on the specified dialect, including support for PostgreSQL-specific operators. - Introduced new snapshot tests for SQLite comparison operators, ensuring correct GraphQL type generation for different dialects. - Improved documentation for comparison operator descriptions in GraphQL schemas to clarify dialect-specific functionality.
- Updated the `dialect` option in `MikroWeaverConfigOptions` to use consistent casing for "PostgreSQL", changing "postgreSQL" to "postgresql" for uniformity.
- Bumped version of '@gqloom/core' to 0.15.2 in pnpm-lock.yaml for improved compatibility. - Added 'reflect-metadata' as a dependency in package.json to support decorator metadata. - Enhanced MikroWeaver to utilize weaverContext for retrieving MetadataStorage, improving configuration flexibility. - Updated various factory and resolver classes to leverage the new getWeaverConfigMetadata function for better metadata management. - Added TypeScript compiler options for experimental decorators and metadata emission in tsconfig.json.
…lver factories - Added detailed explanations for using decorator-defined entities with MikroORM, including setup instructions for `reflect-metadata` and `MikroWeaver.config`. - Updated examples for creating entities and resolvers, clarifying the usage of `MikroResolverFactory` and its configuration options. - Improved descriptions of preset queries and mutations, highlighting their implementation via `EntityManager` methods and the handling of comparison operators in GraphQL queries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PropertyBehavioraccept GraphQLOutputTypecomparisonOperatorsTypebased on different databases