Skip to content

Commit

Permalink
Enhancements (#286)
Browse files Browse the repository at this point in the history
* Enhancements
- Remove circular dep support
- Reimplement forRoot and forChild logic
- Remove modulesMap
- Generate more readable module names
- Reimplement and optimize schema merge logic
- Remove mergeModules
- Add more unit tests
- Implement better directiveResolvers logic
- Make sure session is deleted from memory when WS connection is terminated
- Custom logger definition enhancement
- Move composeResolvers to utils
- FIX: Revert back to the old logic for merging schemas
- Add more tests
- FIX: Check configuration if necessary
- FIX: Call middleware on schema construction time
- FIX: Expose ModuleSessionInfo
- Default scope option
- Ensure iterations are optimized and every schema is validated
- Remove unnecessary `dependency-graph`
- Huge Performance improvements -
  • Loading branch information
ardatan authored Jan 30, 2019
1 parent fa73580 commit a58b0f8
Show file tree
Hide file tree
Showing 21 changed files with 628 additions and 678 deletions.
9 changes: 4 additions & 5 deletions docs/guides/load-your-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ sidebar_label: Load Your Schema and Resolvers

There are multiple ways to load your schema, and GraphQL Modules tries to make it easier as possible for you.

## Using Sonar And Epoxy
## Using Sonar

One of the tools of GraphQL Modules is `@graphql-modules/epoxy`, it has a power mechanism for finding and loading your schema and resolvers files.
One of the tools of GraphQL Modules is `@graphql-modules/sonar`, it has a power mechanism for finding and loading your schema and resolvers files.

Along with `@graphql-modules/epoxy`, you can separate your GraphQL schema definition and resolvers to smaller parts, and load without specifying each file.
Along with `@graphql-modules/sonar`, you can separate your GraphQL schema definition and resolvers to smaller parts, and load without specifying each file.

For example, given the following structure:

Expand All @@ -33,11 +33,10 @@ You can easily load all of your `.graphql` files and `.ts` resolvers files like
```typescript
import { GraphQLModule } from '@graphql-modules/core';
import { loadResolversFiles, loadSchemaFiles } from '@graphql-modules/sonar';
import { mergeResolvers } from '@graphql-modules/epoxy';

export const UserModule = new GraphQLModule({
typeDefs: loadSchemaFiles(__dirname + '/schema/'),
resolvers: mergeResolvers(loadResolversFiles(__dirname + '/resolvers/')),
resolvers: loadResolversFiles(__dirname + '/resolvers/'),
});
```

Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@graphql-modules/di": "0.3.0",
"@graphql-modules/epoxy": "0.3.0",
"dependency-graph": "0.8.0",
"@graphql-modules/utils": "0.3.0",
"graphql-tools": "4.0.4",
"tslib": "1.9.3"
},
Expand Down
Loading

0 comments on commit a58b0f8

Please sign in to comment.