Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Optimize the implementation of Silk #26

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft

Conversation

xcfox
Copy link
Contributor

@xcfox xcfox commented Mar 6, 2025

  • Remove createLoom function from @gqloom/core
  • Remove exports for query, mutation, field, resolver, subscription
  • Update @gqloom/yup to use individual imports instead of createLoom
  • Remove create-loom.ts, create-loom.spec.ts, and index.ts from helper directory
  • Update index.ts in core/src to remove helper import

xcfox added 3 commits March 5, 2025 19:54
- Remove `createLoom` function from `@gqloom/core`
- Remove exports for `query`, `mutation`, `field`, `resolver`, `subscription`
- Update `@gqloom/yup` to use individual imports instead of `createLoom`
- Remove `create-loom.ts`, `create-loom.spec.ts`, and `index.ts` from `helper` directory
- Update `index.ts` in `core/src` to remove `helper` import
- Remove AbstractSchemaIO and GraphQLSilkIO types
- Simplify InferInputI and InferInputO types
- Update FieldOrOperation type to use EnsureSilk for parent type
- Remove unused type parameters from various interfaces
- Update import statements to reflect these changes
- Add support for scalar types with variants (non-null, list, etc.)
- Improve type inference for object types
- Update `silk` function to handle different type variants
- Refactor `InferScalarInternal` and `InferScalarExternal` to support variants
- Update tests and documentation to reflect new type inference capabilities
@xcfox xcfox linked an issue Mar 7, 2025 that may be closed by this pull request
xcfox added 7 commits March 8, 2025 13:53
- Introduce ChainResolver class to handle resolver operations
- Update ResolverFactory to use ChainResolver
- Refactor createQuery, createMutation, and createField to use new resolver structure
- Modify SubscriptionChainFactory to accommodate new subscription creation
- Update types and interfaces to align with the new resolver implementation
- Implement `use` method in `ChainResolver` class to add middlewares
- Update tests to demonstrate the usage of multiple middlewares
- Add logs to verify the execution order of middlewares
- Add `extensions` method to `ChainResolver` class
- Update `resolver.of` to support setting extensions
- Add test case to verify extension setting for object types
- Move FederatedChainResolver to Core
- Add resolver factory and referenceField to Core
- Update Federation package to use new Core functionality
- Refactor and simplify Federation implementation
- Add type definition for ResolveReferenceExtension
- Enhance type checking for apollo.subgraph.resolveReference
- Use type casting to ensure correct type handling
- Update middleware examples for both Valibot and Zod
- Replace `middlewares` field with `use` method for applying middlewares
- Improve clarity and consistency in middleware usage examples
- Enhance explanations of Apollo Federation and GQLoom Federation
- Add examples for declaring directives on objects and resolvers
- Include instructions for adding directives to the schema
- Update code examples throughout the document
- Improve translations in Chinese documentation
@xcfox xcfox linked an issue Mar 8, 2025 that may be closed by this pull request
@xcfox xcfox self-assigned this Mar 8, 2025
xcfox added 15 commits March 9, 2025 02:02
- Update class methods and properties in multiple files to be public
- Adjust static methods to be public in various classes
- Modify constructor parameters to be public
- Add `load` method to `FieldChainFactory` for loading lists of objects
- Implement `getResult` method in `CallableInputParser`
- Update `resolver` to use new `load` method for resolving lists
- Refactor `middleware` application in resolvers
- Improve `weaverContext` to handle configurations and names
- Update `EasyDataLoader` to support cache clearing
…schema

- Add test case to verify casting of union schema without errors
- Include async validation tests for union schema
- Enhance existing validation tests to cover more scenarios
- Add DrizzleResolverFactory abstract class with common resolver methods
- Implement resolver factories for MySQL, PostgreSQL, and SQLite databases
- Add support for CRUD operations and relation fields
- Improve error handling and input validation
- Remove duplicate '@gqloom/valibot', '@gqloom/yup', and '@gqloom/zod' packages
- Consolidate build commands for valibot, yup, and zod into a single command
…ed files

- Introduce QueryFactoryWithResolve class to handle query operations
- Update ChainFactoryWithResolve to extend QueryFactoryWithResolve
- Modify DrizzleResolverFactory to use QueryFactoryWithResolve
- Update types and interfaces to accommodate new query factory structure
- Remove redundant `use` methods from FieldChainFactory, QueryChainFactory, MutationChainFactory, and SubscriptionChainFactory
- Update BaseChainFactory to use a generic type for middlewares
- Adjust related tests and implementations to use the new generic middleware type
- Implement MutationFactoryWithResolve for handling mutations with custom inputs
- Update resolver factories to use MutationFactoryWithResolve for mutation operations
- Add test cases to verify custom input functionality for mutations
- Introduce FieldFactoryWithResolve class to handle field creation with resolve function
- Update DrizzleResolverFactory to use FieldFactoryWithResolve for relation fields
- Modify types in factory/types.ts to incorporate FieldFactoryWithResolve
- Add tests for relation fields using FieldFactoryWithResolve
- Move QueryFactoryWithResolve, MutationFactoryWithResolve, and FieldFactoryWithResolve from drizzle package to core
- Update imports in drizzle packages to use the moved classes from core
- Remove factory/field.ts file as it's no longer needed
…n factory

- Remove unnecessary type assertions in query, mutation, and field factory classes
- Improve code readability and type safety by allowing TypeScript to infer the correct types
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.

enhance dataloader DX Chaining resolver-builder
1 participant