File tree 3 files changed +5
-4
lines changed
packages/integrations/gei-crud
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " gei-crud" ,
3
- "version" : " 0.9.5 " ,
3
+ "version" : " 0.9.6 " ,
4
4
"description" : " GraphQL Editor integration for stucco. Allows basic crud operations and relations." ,
5
5
"main" : " lib/index.js" ,
6
6
"private" : false ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export const createObjects = async (input: FieldResolveInput & Partial<DataInput
12
12
const rt = getReturnTypeName ( input . info . returnType ) ;
13
13
const sourceParameters = prepareSourceParameters ( input )
14
14
const addFields = input . data ?. addFields ? createObjectFromAddFields ( input . data ?. addFields ) : undefined
15
-
15
+
16
16
let objectsToUpdate : any [ ] = [ ] ;
17
17
18
18
for ( const key in args ) {
@@ -36,7 +36,8 @@ export const createObjects = async (input: FieldResolveInput & Partial<DataInput
36
36
37
37
const result = await db ( args . collectionName || input . data ?. model || prepareModel ( input ) )
38
38
. collection . insertMany ( objects )
39
- return rt === 'String' ? `Created ${ result ?. insertedCount } objects` : rt === 'Object' ? result . insertedIds : result . insertedCount > 0
39
+
40
+ return rt === 'String' ? `Created ${ result ?. insertedCount } objects` : rt === 'Boolean' ? result . insertedCount > 0 : Object . values ( result . insertedIds )
40
41
} ) ) ( input . arguments ) ;
41
42
42
43
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { getResolverData } from './shared.js';
5
5
export const prepareSourceParameters = ( input : FieldResolveInput & Partial < DataInput > ) => {
6
6
const source = input . source ;
7
7
let sourceParameters = input . data ?. sourceParameters ;
8
- if ( ! sourceParameters ) {
8
+ if ( ! sourceParameters && ( input . arguments ?. sourceParameters || input . arguments ?. sourceFilterParameters ) ) {
9
9
const { data } = getResolverData < { sourceParameters ?: string [ ] ; sourceFilterParameters ?: string [ ] } > ( input ) ;
10
10
sourceParameters = data ?. sourceParameters ?. value || data ?. sourceFilterParameters ?. value ;
11
11
}
You can’t perform that action at this time.
0 commit comments