File tree 4 files changed +23
-7
lines changed
4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change
1
+ # v0.4.17
2
+ - fix: bug in schema composer where it was not properly handling entities
3
+
1
4
# v0.4.16
2
5
- feat: enhance ` arkiver list ` command, see ` arkiver list --help `
3
6
- feat: added 3 new commands to the CLI:
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
17
17
} from './cli/mod.ts'
18
18
import 'https://deno.land/std@0.179.0/dotenv/load.ts'
19
19
20
- export const version = 'v0.4.16 '
20
+ export const version = 'v0.4.17 '
21
21
22
22
const command = new Command ( )
23
23
. name ( 'arkiver' )
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ export {
24
24
} from 'npm:abitype'
25
25
export { default as mongoose , Schema , Types } from 'npm:mongoose'
26
26
export { SchemaComposer , schemaComposer } from 'npm:graphql-compose'
27
- export { composeMongoose } from 'npm:graphql-compose-mongoose'
27
+ export {
28
+ composeMongoose ,
29
+ type ObjectTypeComposerWithMongooseResolvers ,
30
+ } from 'npm:graphql-compose-mongoose'
28
31
export { LRUCache as Cache } from 'npm:lru-cache'
29
32
export * as log from 'https://deno.land/std@0.181.0/log/mod.ts'
30
33
export * as colors from 'https://deno.land/std@0.181.0/fmt/colors.ts'
Original file line number Diff line number Diff line change 1
1
// deno-lint-ignore-file no-explicit-any
2
- import { composeMongoose , mongoose , SchemaComposer } from '../deps.ts'
2
+ import {
3
+ composeMongoose ,
4
+ mongoose ,
5
+ ObjectTypeComposerWithMongooseResolvers ,
6
+ SchemaComposer ,
7
+ } from '../deps.ts'
3
8
4
9
export const buildSchemaFromEntities = (
5
10
schemaComposer : SchemaComposer ,
6
11
entities : { model : mongoose . Model < any > ; list : boolean } [ ] ,
7
12
) => {
8
13
for ( const { model, list } of entities ) {
9
- const getTC = ( schemaComposer : any , model : any ) => {
14
+ const getTC = (
15
+ schemaComposer : SchemaComposer ,
16
+ model : mongoose . Model < any > ,
17
+ ) => {
10
18
try {
11
- return schemaComposer . getAnyTC ( model . modelName )
19
+ return schemaComposer . getOTC (
20
+ model . modelName ,
21
+ ) as ObjectTypeComposerWithMongooseResolvers < any >
12
22
} catch ( _e ) {
13
- return composeMongoose < any > ( model )
23
+ return composeMongoose < any > ( model , { schemaComposer } )
14
24
}
15
25
}
16
26
@@ -28,7 +38,7 @@ export const buildSchemaFromEntities = (
28
38
[ _id ] : ( source : any ) => source [ path ] ,
29
39
} ,
30
40
projection : { [ path ] : 1 } ,
31
- } )
41
+ } as any )
32
42
}
33
43
}
34
44
You can’t perform that action at this time.
0 commit comments