Skip to content

Conversation

@xcfox
Copy link
Contributor

@xcfox xcfox commented Jun 9, 2025

No description provided.

xcfox added 30 commits April 6, 2025 21:56
…ss MySQL, PostgreSQL, and SQLite schemas

- Updated schema definitions and resolver factories to use pluralized names for users and posts.
- Adjusted GraphQL mutations and queries to reflect the new naming conventions.
- Ensured consistency across all database tests by renaming relevant references and updating relationships.
- Updated the `where` clause in select arguments to utilize a RAW function for improved filter extraction.
- Modified `extractFilters` and `extractFiltersColumn` methods to accept an optional `table` parameter, allowing for more flexible filter handling.
- Ensured that operators are applied to the correct table columns, enhancing the overall query construction process.
- Renamed filter types from `FiltersOr` to `FiltersNested` for improved clarity.
- Introduced `AND` and `NOT` fields in filter definitions to enhance query capabilities.
- Updated related test cases and GraphQL schemas to reflect the new filter structure across MySQL, PostgreSQL, and SQLite.
- Introduced support for `AND`, `OR`, and `NOT` operators in filter processing to improve query flexibility.
- Updated the `extractFilters` method to handle new logical operators and ensure correct extraction of conditions.
- Added corresponding test cases to validate the functionality of the new operators in various query scenarios.
…ctory

- Eliminated the handling of the `OR` operator in the `extractFiltersColumn` method to streamline filter processing.
- Updated related test cases to reflect the removal of `OR` operator support, ensuring consistency in query behavior.
…rFactory

- Improved handling of `AND`, `OR`, and `NOT` operators in the `extractFilters` method to allow for more complex query conditions.
- Updated the `extractFiltersColumn` method to accommodate new logical operator processing.
- Added comprehensive test cases to validate the functionality of the enhanced logical operators in various query scenarios.
…Factory

- Enhanced error handling in the `relationField` method to throw a specific error when a relation is not found or is not a table.
- Added a new test case to verify that the appropriate error is thrown for non-existent relations, ensuring robustness in relation management.
- Renamed filter types from `FiltersOr` to `FiltersNested` for improved clarity.
- Introduced `AND` and `NOT` fields in filter definitions to enhance query capabilities.
- Updated related test cases and GraphQL schemas for MySQL, PostgreSQL, and SQLite to reflect the new filter structure.
…ver factory

- Updated the `drizzleResolverFactory` function to deprecate the use of `tableName`, encouraging users to directly use `table` instead.
- Added detailed deprecation warnings and examples in the code comments to guide users on the preferred usage.
- Modified test cases across MySQL, PostgreSQL, and SQLite to reflect the new usage of `table` instead of `tableName`.
…ase types

- Added support for creating resolver factories for SQLite, PostgreSQL, and MySQL databases.
- Updated the `drizzleResolverFactory` function signatures to accommodate the new database types.
- Included detailed documentation for each resolver factory function to clarify usage and options.
- Removed deprecated function signatures for PostgreSQL and MySQL to streamline the API.
- Updated dependencies in package.json to specific versions for @gqloom/core and @gqloom/drizzle.
- Added graphql-scalars dependency for enhanced scalar types.
- Modified CatsItem schema to use DateTime type for birthday.
- Refactored CatsFilters and SQLite filters to improve query capabilities.
- Enhanced mutation operations for inserting cats with new input types and conflict handling.
- Implemented error handling middleware in the server setup.
- Introduced `matchQueryBuilder` function in the helper module to facilitate matching query builders with target tables.
- Updated `DrizzleResolverFactory` to utilize `matchQueryBuilder`, improving error handling for relations by ensuring the presence of a valid query builder.
- Modified `tablesFilter` in MySQL and Postgres configurations to include specific tables: `users` and `posts`.
- Expanded `tablesFilter` in SQLite configurations to include additional tables: `users`, `posts`, `courses`, `studentToCourses`, and `studentCourseGrades`.
- Removed unused `matchQueryBuilder` function from the helper module to streamline code.
@xcfox xcfox linked an issue Jun 9, 2025 that may be closed by this pull request
@xcfox xcfox marked this pull request as draft June 9, 2025 08:45
xcfox and others added 26 commits June 9, 2025 19:19
…mns from resolver payload

- Implemented getQueriedColumns to extract columns from the resolver payload.
- Updated tests to verify the functionality of the new method.
…o query string format

- Implemented paramsAsKey to convert various data structures (objects, arrays) into a URL query string format.
- Added comprehensive tests to validate the functionality of paramsAsKey, covering edge cases and nested structures.
…e-to-many and many-to-one relationships

- Added methods for handling relation arguments in the DrizzleInputFactory.
- Enhanced RelationFieldLoader to support batch loading for both one-to-many and many-to-one relationships.
- Updated resolver factory to utilize new relation argument structures.
- Removed unused getQueriedColumns function from helper.
- Added tests to validate the new relation loading functionality.
…update resolver tests

- Added reviewerId field to Post schema and updated related GraphQL types.
- Implemented reviewedPosts relation in the user schema for tracking posts reviewed by users.
- Enhanced resolver tests to validate functionality with aliased relations and new fields.
- Updated SQL queries in tests to include reviewerId for accurate data handling.
…y relations

- Added tests to validate limit and offset functionality for to-many relations in the resolver.
- Implemented tests for orderBy functionality, ensuring correct sorting of related posts.
- Enhanced existing test cases to ensure comprehensive coverage of relation handling.
…olver tests

- Removed redundant comments regarding the deletion of existing posts and insertion of new test data.
- Streamlined the test cases for verifying the order of posts, focusing on ascending and descending order checks.
…ferences

- Updated paramsAsKey function to correctly serialize functions as "[Function]".
- Implemented handling for circular references in both arrays and objects, ensuring proper representation in the query string.
- Added tests to validate the new functionality, including cases for functions and recursive objects.
…ptions to support generic table types

- Updated QueryToOneFieldOptions and QueryToManyFieldOptions to accept generic table types, allowing for more flexible query definitions.
- Modified RelationFieldLoader and DrizzleResolverFactory to utilize the new generic options, improving type safety and functionality.
- Added tests to validate the handling of where clauses for both to-many and to-one relations, ensuring correct filtering behavior.
… for tables

- Introduced getPrimaryColumns function to fetch primary key columns for various table types (MySQL, PostgreSQL, SQLite).
- Updated RelationFieldLoader to utilize getPrimaryColumns for improved primary key handling.
- Added tests to validate the functionality of getPrimaryColumns across different database schemas.
- Removed the fieldsLength property from RelationFieldLoader as it was unnecessary for the current implementation.
- Streamlined the constructor by eliminating the assignment of fieldsLength, enhancing code clarity.
…ading and add new GraphQL features

- Introduced getFullPath function in helper to retrieve the full path of GraphQL resolve info.
- Updated RelationFieldLoader to utilize getFullPath for improved input grouping based on GraphQL context.
- Enhanced resolver tests to validate the aggregation of relation fields, including starred posts and their associated filters.
- Added new GraphQL types and filters for user-starred posts in the schema, improving the flexibility of relation queries.
…ns and improve relation loading

- Replaced getFullPath with getParentPath in helper for better clarity in path retrieval.
- Introduced pathKey function to simplify key handling in GraphQLResolveInfo.
- Updated RelationFieldLoader to utilize new path handling methods, enhancing loader efficiency.
- Removed unused paramsAsKey function and related tests to clean up the codebase.
- Adjusted resolver factory to integrate RelationFieldsLoader for improved relation handling.
feat(drizzle): support filters for relations
…nce argument transformation

- Updated mutation input types across MySQL, PostgreSQL, and SQLite resolvers to use unified options interfaces.
- Introduced DrizzleArgsTransformer to streamline argument transformation for various mutation types.
- Refactored input handling in resolver factories to improve clarity and maintainability.
- Added new interfaces for InsertArrayOptions, InsertSingleOptions, UpdateOptions, and DeleteOptions to standardize input structures.
…n and streamline input handling

- Renamed and refactored visibility behavior types to column behavior types for clarity.
- Updated the `isColumnVisible` function to handle new column behavior configurations.
- Adjusted the constructor of `DrizzleArgsTransformer` to accept options for better input management.
- Modified tests to reflect changes in the column behavior interface and ensure compatibility.
…silk retrieval

- Implemented `validateInsertValue` method to validate insert values against column schemas, returning structured results and issues.
- Added `getColumnSilk` method to retrieve column behavior configurations for insert and update mutations, improving input handling in `DrizzleArgsTransformer`.
… for insert and update options

- Updated methods in DrizzleArgsTransformer to return MayPromise types for select, insert, and update options, enabling asynchronous validation.
- Implemented async validation for insert values and update values, improving error handling and input integrity.
- Refactored to ensure consistent handling of validation issues across various transformation methods.
…rt and update mutations

- Added `getColumnInputType` method to dynamically determine GraphQL types based on column configurations for insert and update operations.
- Refactored input field generation in `insertInput` and `updateInput` methods to utilize the new dynamic type retrieval, improving flexibility and maintainability.
- Updated tests to ensure proper context handling and visibility checks for input fields.
…eSQL, and SQLite resolvers

- Implemented tests to ensure that inserting and updating users with invalid email formats throws appropriate errors.
- Enhanced user input handling by integrating Valibot for email validation in resolver factories.
- Updated existing tests to improve error handling and maintain consistency across different database resolvers.
feat(drizzle): custom factory silk validation
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.

Drizzle Relational API v2

2 participants