File tree 1 file changed +17
-0
lines changed
packages/openapi-to-graphql/src
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,23 @@ const CleanGraphQLJSON = new GraphQLScalarType({
115
115
cleanValue = { ...value }
116
116
117
117
delete cleanValue [ OPENAPI_TO_GRAPHQL ]
118
+ } else if (
119
+ /**
120
+ * As an exception to the above case an object may be an array defined as an object
121
+ * where the array members contain an arbitrary JSON and *do* have the
122
+ * _openAPIToGraphQL field which must be removed
123
+ */
124
+ value &&
125
+ typeof value === 'object' &&
126
+ value . length > 0 &&
127
+ typeof value [ 0 ] == 'object' &&
128
+ typeof value [ 0 ] [ OPENAPI_TO_GRAPHQL ] === 'object'
129
+ ) {
130
+ cleanValue = value . map ( ( member ) => {
131
+ const cleanmember = { ...member }
132
+ delete cleanmember [ OPENAPI_TO_GRAPHQL ]
133
+ return cleanmember
134
+ } )
118
135
119
136
/**
120
137
* As a GraphQLJSON type, the value can also be a scalar or array or
You can’t perform that action at this time.
0 commit comments