File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ export type MongooseFieldT = {
4343
4444export type MongooseFieldMapT = { [ fieldName : string ] : MongooseFieldT } ;
4545
46- export type ResolverNames = 'byId' | 'byIds' | 'findOne' | 'findMany' |
47- 'updateOne' | 'updateMany' | 'removeOne' | 'removeMany' ;
46+ export type ResolverNames = 'findById' | 'findByIds' | 'findOne' | 'findMany' |
47+ 'updateById' | 'updateOne' | 'updateMany' |
48+ 'removeById' | 'removeOne' | 'removeMany' |
49+ 'createOne' | 'count' ;
4850
4951export type MongooseQuery = {
5052 exec ( ) : Promise ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type inputHelperArgsGenOpts = {
1212 inputTypeName : string ,
1313 removeFields ?: string | string [ ] ,
1414 requiredFields ?: string | string [ ] ,
15+ isRequired ?: boolean ,
1516} ;
1617
1718export const inputHelperArgsGen = (
@@ -36,7 +37,9 @@ export const inputHelperArgsGen = (
3637 return {
3738 input : {
3839 name : 'input' ,
39- type : inputComposer . getType ( ) ,
40+ type : opts . isRequired
41+ ? new GraphQLNonNull ( inputComposer . getType ( ) )
42+ : inputComposer . getType ( ) ,
4043 } ,
4144 } ;
4245} ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export default function updateById(
4343 ...inputHelperArgsGen ( gqType , {
4444 inputTypeName : `UpdateById${ gqType . name } Input` ,
4545 requiredFields : [ '_id' ] ,
46+ isRequired : true ,
4647 } ) ,
4748 } ,
4849 resolve : ( resolveParams : ExtendedResolveParams ) => {
You can’t perform that action at this time.
0 commit comments