graphile-build-pg
Advanced tools
Comparing version 4.0.0-beta.4 to 4.0.0-beta.5
@@ -204,3 +204,4 @@ "use strict"; | ||
} | ||
return sql.fragment`${sql.identifier(proc.namespace.name, proc.name)}(${sql.join([...implicitArgs, ...sqlArgValues], ", ")})`; | ||
const functionCall = sql.fragment`${sql.identifier(proc.namespace.name, proc.name)}(${sql.join([...implicitArgs, ...sqlArgValues], ", ")})`; | ||
return rawReturnType.isPgArray ? sql.fragment`unnest(${functionCall})` : functionCall; | ||
} | ||
@@ -213,3 +214,4 @@ function makeQuery(parsedResolveInfoFragment, ReturnType, sqlMutationQuery, functionAlias) { | ||
asJson: !proc.returnsSet && computed && !returnFirstValueAsValue, | ||
addNullCase: !proc.returnsSet && isTableLike | ||
asJsonAggregate: !proc.returnsSet && computed && rawReturnType.isPgArray, | ||
addNullCase: !proc.returnsSet && !rawReturnType.isPgArray && isTableLike | ||
}, innerQueryBuilder => { | ||
@@ -328,3 +330,2 @@ if (!isTableLike) { | ||
const query = makeQuery(parsedResolveInfoFragment, resolveInfo.returnType, functionAlias, functionAlias); | ||
const returnType = rawReturnType; | ||
const intermediateIdentifier = sql.identifier(Symbol()); | ||
@@ -361,7 +362,9 @@ const isVoid = returnType.id === "2278"; | ||
// Connection | ||
return (0, _addStartEndCursor2.default)(row); | ||
} else if (proc.returnsSet) { | ||
return rows; | ||
return (0, _addStartEndCursor2.default)({ | ||
data: row.data.map(row => pg2gql(row, returnType)) | ||
}); | ||
} else if (proc.returnsSet || rawReturnType.isPgArray) { | ||
return rows.map(row => pg2gql(row, returnType)); | ||
} else { | ||
return row; | ||
return pg2gql(row, returnType); | ||
} | ||
@@ -368,0 +371,0 @@ } |
{ | ||
"name": "graphile-build-pg", | ||
"version": "4.0.0-beta.4", | ||
"version": "4.0.0-beta.5", | ||
"description": "Build a GraphQL schema by reflection over a PostgreSQL schema. Easy to customize since it's built with plugins on graphile-build", | ||
@@ -8,3 +8,3 @@ "main": "node8plus/index.js", | ||
"test": "jest", | ||
"prepublish": "mkdir -p node8plus && babel -s true --out-dir node8plus src && flow-copy-source src node8plus", | ||
"prepack": "mkdir -p node8plus && babel -s true --out-dir node8plus src && flow-copy-source src node8plus", | ||
"watch": "mkdir -p node8plus && babel -s true --watch --out-dir node8plus src" | ||
@@ -40,3 +40,3 @@ }, | ||
"debug": ">=2 <3", | ||
"graphile-build": "4.0.0-beta.4", | ||
"graphile-build": "4.0.0-beta.5", | ||
"graphql-iso-date": "^3.2.0", | ||
@@ -43,0 +43,0 @@ "jsonwebtoken": "^8.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
962032
125
5231
+ Addedgraphile-build@4.0.0-beta.5(transitive)
+ Addedgraphql-parse-resolve-info@4.0.0-beta.5(transitive)
- Removedgraphile-build@4.0.0-beta.4(transitive)
- Removedgraphql-parse-resolve-info@4.0.0-beta.4(transitive)
Updatedgraphile-build@4.0.0-beta.5