-
Notifications
You must be signed in to change notification settings - Fork 1
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
xcfox
wants to merge
25
commits into
main
Choose a base branch
from
silk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
- 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
- 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
- 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
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.
createLoom
function from@gqloom/core
query
,mutation
,field
,resolver
,subscription
@gqloom/yup
to use individual imports instead ofcreateLoom
create-loom.ts
,create-loom.spec.ts
, andindex.ts
fromhelper
directoryindex.ts
incore/src
to removehelper
import