Skip to content

feat: Enhance MikroORM Integration#287

Merged
xcfox merged 10 commits intomodevol-com:mainfrom
xcfox:mikro-silk
Feb 7, 2026
Merged

feat: Enhance MikroORM Integration#287
xcfox merged 10 commits intomodevol-com:mainfrom
xcfox:mikro-silk

Conversation

@xcfox
Copy link
Contributor

@xcfox xcfox commented Feb 5, 2026

  • mikroSilk.config.field supports silk input
  • Respect and run the silk validation process on MikroFactoryPropertyBehaviors
  • PropertyBehavior accept GraphQLOutputType
  • Hide Filter field in comparisonOperatorsType based on different databases
  • Support defining entities using classes and decorators

xcfox added 2 commits February 5, 2026 23:27
- 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.
@xcfox xcfox linked an issue Feb 5, 2026 that may be closed by this pull request
xcfox added 2 commits February 6, 2026 01:02
…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.
@xcfox xcfox marked this pull request as draft February 5, 2026 20:51
xcfox added 6 commits February 7, 2026 15:09
…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.
@xcfox xcfox marked this pull request as ready for review February 7, 2026 11:39
@xcfox xcfox merged commit e82a79e into modevol-com:main Feb 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MikroORM: handle Enitity from defined by Decorated classes

1 participant