@pothos/core
Advanced tools
Comparing version 3.10.0 to 3.10.1
# Change Log | ||
## 3.10.1 | ||
### Patch Changes | ||
- 89f09498: Fix issue with argument mapping utils that caused nested lists of input objects to be | ||
transformed incorrectly in the relay plugin | ||
## 3.10.0 | ||
@@ -4,0 +11,0 @@ |
@@ -30,3 +30,3 @@ export function resolveInputTypeConfig(type, buildCache) { | ||
...mapping, | ||
typeFields: { | ||
fields: { | ||
configs: mapping.fields.configs, | ||
@@ -48,6 +48,6 @@ map: filteredTypeFields | ||
map.forEach((mapping) => { | ||
if (mapping.value !== null || mapping.kind !== "InputObject") { | ||
if (mapping.value !== null) { | ||
result = true; | ||
} | ||
else if (mapping.fields.map && checkForMappings(mapping.fields.map, hasMappings)) { | ||
else if (mapping.kind === "InputObject" && mapping.fields.map && checkForMappings(mapping.fields.map, hasMappings)) { | ||
result = true; | ||
@@ -108,3 +108,3 @@ } | ||
if (field.kind === "InputObject" && field.fields.map) { | ||
fieldVal = mapObject(fieldVal, field.fields.map); | ||
fieldVal = field.isList ? fieldVal.map((val) => val && mapObject(val, field.fields.map)) : mapObject(fieldVal, field.fields.map); | ||
mapped[fieldName] = fieldVal; | ||
@@ -111,0 +111,0 @@ } |
@@ -37,3 +37,3 @@ "use strict"; | ||
...mapping, | ||
typeFields: { | ||
fields: { | ||
configs: mapping.fields.configs, | ||
@@ -55,5 +55,5 @@ map: filteredTypeFields | ||
map.forEach((mapping)=>{ | ||
if (mapping.value !== null || mapping.kind !== 'InputObject') { | ||
if (mapping.value !== null) { | ||
result = true; | ||
} else if (mapping.fields.map && checkForMappings(mapping.fields.map, hasMappings)) { | ||
} else if (mapping.kind === 'InputObject' && mapping.fields.map && checkForMappings(mapping.fields.map, hasMappings)) { | ||
result = true; | ||
@@ -114,3 +114,4 @@ } | ||
if (field.kind === 'InputObject' && field.fields.map) { | ||
fieldVal = mapObject(fieldVal, field.fields.map); | ||
fieldVal = field.isList ? fieldVal.map((val)=>val && mapObject(val, field.fields.map) | ||
) : mapObject(fieldVal, field.fields.map); | ||
mapped[fieldName] = fieldVal; | ||
@@ -117,0 +118,0 @@ } |
{ | ||
"name": "@pothos/core", | ||
"version": "3.10.0", | ||
"version": "3.10.1", | ||
"description": "Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -95,3 +95,3 @@ import BuildCache from '../build-cache'; | ||
...mapping, | ||
typeFields: { | ||
fields: { | ||
configs: mapping.fields.configs, | ||
@@ -122,5 +122,9 @@ map: filteredTypeFields, | ||
map.forEach((mapping) => { | ||
if (mapping.value !== null || mapping.kind !== 'InputObject') { | ||
if (mapping.value !== null) { | ||
result = true; | ||
} else if (mapping.fields.map && checkForMappings(mapping.fields.map, hasMappings)) { | ||
} else if ( | ||
mapping.kind === 'InputObject' && | ||
mapping.fields.map && | ||
checkForMappings(mapping.fields.map, hasMappings) | ||
) { | ||
result = true; | ||
@@ -206,3 +210,8 @@ } | ||
if (field.kind === 'InputObject' && field.fields.map) { | ||
fieldVal = mapObject(fieldVal as Record<string, unknown>, field.fields.map); | ||
fieldVal = field.isList | ||
? (fieldVal as (Record<string, unknown> | null)[]).map( | ||
(val) => val && mapObject(val, field.fields.map!), | ||
) | ||
: mapObject(fieldVal as Record<string, unknown>, field.fields.map); | ||
mapped[fieldName] = fieldVal; | ||
@@ -209,0 +218,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1210707
11868