graphile-build-pg
Advanced tools
Comparing version 0.1.0-alpha.35 to 0.1.0-alpha.36
@@ -145,4 +145,6 @@ "use strict"; | ||
var type = void 0; | ||
var scope = {}; | ||
scope.pgIntrospection = proc; | ||
var fieldScope = {}; | ||
var payloadTypeScope = {}; | ||
fieldScope.pgFieldIntrospection = proc; | ||
payloadTypeScope.pgIntrospection = proc; | ||
var returnFirstValueAsValue = false; | ||
@@ -162,5 +164,6 @@ var TableType = returnTypeTable && pgGetGqlTypeByTypeId(returnTypeTable.type.id); | ||
type = new GraphQLNonNull(ConnectionType); | ||
scope.isPgConnectionField = true; | ||
fieldScope.isPgFieldConnection = true; | ||
} | ||
scope.pgIntrospectionTable = returnTypeTable; | ||
fieldScope.pgFieldIntrospectionTable = returnTypeTable; | ||
payloadTypeScope.pgIntrospectionTable = returnTypeTable; | ||
} else { | ||
@@ -171,3 +174,4 @@ type = TableType; | ||
} | ||
scope.pgIntrospectionTable = returnTypeTable; | ||
fieldScope.pgFieldIntrospectionTable = returnTypeTable; | ||
payloadTypeScope.pgIntrospectionTable = returnTypeTable; | ||
} | ||
@@ -186,3 +190,3 @@ } else { | ||
type = new GraphQLNonNull(_ConnectionType); | ||
scope.isPgConnectionField = true; | ||
fieldScope.isPgFieldConnection = true; | ||
} | ||
@@ -223,12 +227,25 @@ } else { | ||
var args = isMutation ? rawArgs.input : rawArgs; | ||
var sqlArgValues = argNames.map(function (argName, argIndex) { | ||
var sqlArgValues = []; | ||
var haveNames = true; | ||
for (var argIndex = argNames.length - 1; argIndex >= 0; argIndex--) { | ||
var argName = argNames[argIndex]; | ||
var gqlArgName = inflection.argument(argName, argIndex); | ||
return gql2pg(args[gqlArgName], argTypes[argIndex]); | ||
}); | ||
// Removes null arguments from end of args list if those arguments have | ||
// defaults in SQL. | ||
while (sqlArgValues.length > requiredArgCount && args[inflection.argument(argNames[sqlArgValues.length - 1], sqlArgValues.length - 1)] == null) { | ||
sqlArgValues.pop(); | ||
var value = args[gqlArgName]; | ||
var sqlValue = gql2pg(value, argTypes[argIndex]); | ||
if (argIndex + 1 > requiredArgCount && haveNames && value == null) { | ||
// No need to pass argument to function | ||
continue; | ||
} else if (argIndex + 1 > requiredArgCount && haveNames) { | ||
var sqlArgName = argName ? sql.identifier(argName) : null; | ||
if (sqlArgName) { | ||
sqlArgValues.unshift(sql.fragment`${sqlArgName} := ${sqlValue}`); | ||
} else { | ||
haveNames = false; | ||
sqlArgValues.unshift(sqlValue); | ||
} | ||
} else { | ||
sqlArgValues.unshift(sqlValue); | ||
} | ||
} | ||
return sql.fragment`${sql.identifier(proc.namespace.name, proc.name)}(${sql.join([].concat((0, _toConsumableArray3.default)(implicitArgs), (0, _toConsumableArray3.default)(sqlArgValues)), ", ")})`; | ||
return sql.fragment`${sql.identifier(proc.namespace.name, proc.name)}(${sql.join([].concat((0, _toConsumableArray3.default)(implicitArgs), sqlArgValues), ", ")})`; | ||
} | ||
@@ -309,3 +326,3 @@ function makeQuery(parsedResolveInfoFragment, ReturnType, sqlMutationQuery, functionAlias) { | ||
isMutationPayload: true | ||
}, scope)); | ||
}, payloadTypeScope)); | ||
ReturnType = PayloadType; | ||
@@ -473,4 +490,4 @@ var InputType = newWithHooks(GraphQLInputObjectType, { | ||
}; | ||
}, scope); | ||
}, fieldScope); | ||
} | ||
//# sourceMappingURL=makeProcField.js.map |
@@ -29,2 +29,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isPageInfoStartCursorField: true | ||
}), | ||
@@ -41,2 +43,4 @@ endCursor: fieldWithHooks("endCursor", function (_ref4) { | ||
}; | ||
}, { | ||
isPageInfoStartCursorField: true | ||
}) | ||
@@ -43,0 +47,0 @@ }); |
@@ -160,4 +160,4 @@ "use strict"; | ||
}, { | ||
isPgConnectionField: true, | ||
pgIntrospection: table | ||
isPgFieldConnection: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -164,0 +164,0 @@ } |
@@ -166,4 +166,4 @@ "use strict"; | ||
}, { | ||
isPgConnectionField: true, | ||
pgIntrospection: table | ||
isPgFieldConnection: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -170,0 +170,0 @@ return memo; |
@@ -11,4 +11,2 @@ "use strict"; | ||
var _graphql = require("graphql"); | ||
var _queryFromResolveData = require("../queryFromResolveData"); | ||
@@ -20,6 +18,7 @@ | ||
var nullableIf = function nullableIf(condition, Type) { | ||
return condition ? Type : new _graphql.GraphQLNonNull(Type); | ||
var nullableIf = function nullableIf(GraphQLNonNull, condition, Type) { | ||
return condition ? Type : new GraphQLNonNull(Type); | ||
}; | ||
var defaultPgColumnFilter = function defaultPgColumnFilter(_attr, _build, _context) { | ||
@@ -40,2 +39,5 @@ return true; | ||
pg2gql = build.pg2gql, | ||
_build$graphql = build.graphql, | ||
GraphQLString = _build$graphql.GraphQLString, | ||
GraphQLNonNull = _build$graphql.GraphQLNonNull, | ||
getAliasFromResolveInfo = build.getAliasFromResolveInfo, | ||
@@ -76,3 +78,3 @@ pgTweakFragmentForType = build.pgTweakFragmentForType; | ||
var ReturnType = pgGetGqlTypeByTypeId(attr.typeId) || _graphql.GraphQLString; | ||
var ReturnType = pgGetGqlTypeByTypeId(attr.typeId) || GraphQLString; | ||
addDataGenerator(function (parsedResolveInfoFragment) { | ||
@@ -108,3 +110,3 @@ var alias = parsedResolveInfoFragment.alias; | ||
description: attr.description, | ||
type: nullableIf(!attr.isNotNull && !attr.type.domainIsNotNull, ReturnType), | ||
type: nullableIf(GraphQLNonNull, !attr.isNotNull && !attr.type.domainIsNotNull, ReturnType), | ||
resolve: function resolve(data, _args, _context, resolveInfo) { | ||
@@ -115,3 +117,3 @@ var alias = getAliasFromResolveInfo(resolveInfo); | ||
}; | ||
}); | ||
}, { pgFieldIntrospection: attr }); | ||
return memo; | ||
@@ -123,3 +125,6 @@ }, {})); | ||
pgGetGqlInputTypeByTypeId = build.pgGetGqlInputTypeByTypeId, | ||
introspectionResultsByKind = build.pgIntrospectionResultsByKind; | ||
introspectionResultsByKind = build.pgIntrospectionResultsByKind, | ||
_build$graphql2 = build.graphql, | ||
GraphQLString = _build$graphql2.GraphQLString, | ||
GraphQLNonNull = _build$graphql2.GraphQLNonNull; | ||
var _context$scope2 = context.scope, | ||
@@ -146,3 +151,3 @@ isPgRowType = _context$scope2.isPgRowType, | ||
description: attr.description, | ||
type: nullableIf(isPgPatch || !attr.isNotNull && !attr.type.domainIsNotNull || attr.hasDefault, pgGetGqlInputTypeByTypeId(attr.typeId) || _graphql.GraphQLString) | ||
type: nullableIf(GraphQLNonNull, isPgPatch || !attr.isNotNull && !attr.type.domainIsNotNull || attr.hasDefault, pgGetGqlInputTypeByTypeId(attr.typeId) || GraphQLString) | ||
}); | ||
@@ -149,0 +154,0 @@ return memo; |
@@ -68,7 +68,7 @@ "use strict"; | ||
var _context$scope = context.scope, | ||
isPgConnectionField = _context$scope.isPgConnectionField, | ||
table = _context$scope.pgIntrospection, | ||
isPgFieldConnection = _context$scope.isPgFieldConnection, | ||
table = _context$scope.pgFieldIntrospection, | ||
addArgDataGenerator = context.addArgDataGenerator; | ||
if (!isPgConnectionField || !table || table.kind !== "class" || !table.namespace) { | ||
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace) { | ||
return args; | ||
@@ -75,0 +75,0 @@ } |
@@ -18,7 +18,7 @@ "use strict"; | ||
var _ref2$scope = _ref2.scope, | ||
isPgConnectionField = _ref2$scope.isPgConnectionField, | ||
source = _ref2$scope.pgIntrospection, | ||
isPgFieldConnection = _ref2$scope.isPgFieldConnection, | ||
source = _ref2$scope.pgFieldIntrospection, | ||
addArgDataGenerator = _ref2.addArgDataGenerator; | ||
if (!isPgConnectionField || !source || source.kind !== "class" && source.kind !== "procedure") { | ||
if (!isPgFieldConnection || !source || source.kind !== "class" && source.kind !== "procedure") { | ||
return args; | ||
@@ -25,0 +25,0 @@ } |
@@ -56,7 +56,7 @@ "use strict"; | ||
var _ref4$scope = _ref4.scope, | ||
isPgConnectionField = _ref4$scope.isPgConnectionField, | ||
table = _ref4$scope.pgIntrospection, | ||
isPgFieldConnection = _ref4$scope.isPgFieldConnection, | ||
table = _ref4$scope.pgFieldIntrospection, | ||
addArgDataGenerator = _ref4.addArgDataGenerator; | ||
if (!isPgConnectionField || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) { | ||
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) { | ||
return args; | ||
@@ -63,0 +63,0 @@ } |
@@ -34,2 +34,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgConnectionTotalCountField: true | ||
}) | ||
@@ -36,0 +38,0 @@ }); |
@@ -138,2 +138,4 @@ "use strict"; | ||
}; | ||
}, { | ||
pgFieldIntrospection: constraint | ||
}); | ||
@@ -140,0 +142,0 @@ return memo; |
@@ -221,2 +221,5 @@ "use strict"; | ||
}; | ||
}, { | ||
pgFieldIntrospection: table, | ||
isPgCreateMutationField: true | ||
}); | ||
@@ -223,0 +226,0 @@ return memo; |
@@ -94,2 +94,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgMutationPayloadEdgeField: true, | ||
pgFieldIntrospection: table | ||
}) | ||
@@ -96,0 +99,0 @@ }); |
@@ -386,2 +386,6 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgNodeMutation: true, | ||
pgFieldIntrospection: table, | ||
[mode === "update" ? "isPgUpdateMutationField" : "isPgDeleteMutationField"]: true | ||
}); | ||
@@ -472,2 +476,6 @@ } | ||
}; | ||
}, { | ||
isPgNodeMutation: false, | ||
pgFieldIntrospection: table, | ||
[mode === "update" ? "isPgUpdateMutationField" : "isPgDeleteMutationField"]: true | ||
}); | ||
@@ -474,0 +482,0 @@ }); |
@@ -143,2 +143,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgRowByUniqueConstraintField: true, | ||
pgFieldIntrospection: constraint | ||
}); | ||
@@ -145,0 +148,0 @@ }); |
@@ -246,2 +246,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgNodeQuery: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -248,0 +251,0 @@ } |
@@ -66,2 +66,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isCursorField: true | ||
}), | ||
@@ -68,0 +70,0 @@ node: { |
@@ -217,2 +217,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isCursorField: true | ||
}), | ||
@@ -219,0 +221,0 @@ node: { |
@@ -246,5 +246,9 @@ "use strict"; | ||
}, | ||
// Numbers may be too large for GraphQL/JS to handle, so stringify by | ||
// default. | ||
N: function N() { | ||
return _graphql.GraphQLFloat; | ||
return _graphql.GraphQLString; | ||
}, | ||
A: function A(type) { | ||
@@ -312,3 +316,7 @@ return new _graphql.GraphQLList(enforceGqlTypeByPgType(pgTypeById[type.arrayItemTypeId])); | ||
"23": _graphql.GraphQLInt, // int4 | ||
"700": _graphql.GraphQLFloat, // float4 | ||
"701": _graphql.GraphQLFloat, // float8 | ||
"1700": _graphql.GraphQLString, // numeric | ||
"790": _graphql.GraphQLFloat, // money | ||
"1186": GQLInterval, // interval | ||
@@ -320,5 +328,9 @@ "1082": SimpleDate, // date | ||
"1266": SimpleTime, // timetz | ||
"114": SimpleJSON, // json | ||
"3802": SimpleJSON, // jsonb | ||
"2950": SimpleUUID // uuid | ||
"2950": SimpleUUID, // uuid | ||
"1560": _graphql.GraphQLString, // bit | ||
"1562": _graphql.GraphQLString // varbit | ||
}, pgExtendedTypes && { | ||
@@ -325,0 +337,0 @@ "114": _graphqlTypeJson2.default, |
@@ -123,4 +123,6 @@ "use strict"; | ||
let type; | ||
const scope = {}; | ||
scope.pgIntrospection = proc; | ||
const fieldScope = {}; | ||
const payloadTypeScope = {}; | ||
fieldScope.pgFieldIntrospection = proc; | ||
payloadTypeScope.pgIntrospection = proc; | ||
let returnFirstValueAsValue = false; | ||
@@ -140,5 +142,6 @@ const TableType = returnTypeTable && pgGetGqlTypeByTypeId(returnTypeTable.type.id); | ||
type = new GraphQLNonNull(ConnectionType); | ||
scope.isPgConnectionField = true; | ||
fieldScope.isPgFieldConnection = true; | ||
} | ||
scope.pgIntrospectionTable = returnTypeTable; | ||
fieldScope.pgFieldIntrospectionTable = returnTypeTable; | ||
payloadTypeScope.pgIntrospectionTable = returnTypeTable; | ||
} else { | ||
@@ -149,3 +152,4 @@ type = TableType; | ||
} | ||
scope.pgIntrospectionTable = returnTypeTable; | ||
fieldScope.pgFieldIntrospectionTable = returnTypeTable; | ||
payloadTypeScope.pgIntrospectionTable = returnTypeTable; | ||
} | ||
@@ -164,3 +168,3 @@ } else { | ||
type = new GraphQLNonNull(ConnectionType); | ||
scope.isPgConnectionField = true; | ||
fieldScope.isPgFieldConnection = true; | ||
} | ||
@@ -195,10 +199,23 @@ } else { | ||
const args = isMutation ? rawArgs.input : rawArgs; | ||
const sqlArgValues = argNames.map((argName, argIndex) => { | ||
const sqlArgValues = []; | ||
let haveNames = true; | ||
for (let argIndex = argNames.length - 1; argIndex >= 0; argIndex--) { | ||
const argName = argNames[argIndex]; | ||
const gqlArgName = inflection.argument(argName, argIndex); | ||
return gql2pg(args[gqlArgName], argTypes[argIndex]); | ||
}); | ||
// Removes null arguments from end of args list if those arguments have | ||
// defaults in SQL. | ||
while (sqlArgValues.length > requiredArgCount && args[inflection.argument(argNames[sqlArgValues.length - 1], sqlArgValues.length - 1)] == null) { | ||
sqlArgValues.pop(); | ||
const value = args[gqlArgName]; | ||
const sqlValue = gql2pg(value, argTypes[argIndex]); | ||
if (argIndex + 1 > requiredArgCount && haveNames && value == null) { | ||
// No need to pass argument to function | ||
continue; | ||
} else if (argIndex + 1 > requiredArgCount && haveNames) { | ||
const sqlArgName = argName ? sql.identifier(argName) : null; | ||
if (sqlArgName) { | ||
sqlArgValues.unshift(sql.fragment`${sqlArgName} := ${sqlValue}`); | ||
} else { | ||
haveNames = false; | ||
sqlArgValues.unshift(sqlValue); | ||
} | ||
} else { | ||
sqlArgValues.unshift(sqlValue); | ||
} | ||
} | ||
@@ -279,3 +296,3 @@ return sql.fragment`${sql.identifier(proc.namespace.name, proc.name)}(${sql.join([...implicitArgs, ...sqlArgValues], ", ")})`; | ||
isMutationPayload: true | ||
}, scope)); | ||
}, payloadTypeScope)); | ||
ReturnType = PayloadType; | ||
@@ -378,4 +395,4 @@ const InputType = newWithHooks(GraphQLInputObjectType, { | ||
}; | ||
}, scope); | ||
}, fieldScope); | ||
} | ||
//# sourceMappingURL=makeProcField.js.map |
@@ -20,2 +20,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isPageInfoStartCursorField: true | ||
}), | ||
@@ -28,2 +30,4 @@ endCursor: fieldWithHooks("endCursor", ({ addDataGenerator }) => { | ||
}; | ||
}, { | ||
isPageInfoStartCursorField: true | ||
}) | ||
@@ -30,0 +34,0 @@ }); |
@@ -93,4 +93,4 @@ "use strict"; | ||
}, { | ||
isPgConnectionField: true, | ||
pgIntrospection: table | ||
isPgFieldConnection: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -97,0 +97,0 @@ } |
@@ -125,4 +125,4 @@ "use strict"; | ||
}, { | ||
isPgConnectionField: true, | ||
pgIntrospection: table | ||
isPgFieldConnection: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -129,0 +129,0 @@ return memo; |
@@ -11,4 +11,2 @@ "use strict"; | ||
var _graphql = require("graphql"); | ||
var _queryFromResolveData = require("../queryFromResolveData"); | ||
@@ -20,4 +18,5 @@ | ||
const nullableIf = (condition, Type) => condition ? Type : new _graphql.GraphQLNonNull(Type); | ||
const nullableIf = (GraphQLNonNull, condition, Type) => condition ? Type : new GraphQLNonNull(Type); | ||
const defaultPgColumnFilter = (_attr, _build, _context) => true; | ||
@@ -33,2 +32,3 @@ | ||
pg2gql, | ||
graphql: { GraphQLString, GraphQLNonNull }, | ||
getAliasFromResolveInfo, | ||
@@ -61,3 +61,3 @@ pgTweakFragmentForType | ||
memo[fieldName] = fieldWithHooks(fieldName, ({ getDataFromParsedResolveInfoFragment, addDataGenerator }) => { | ||
const ReturnType = pgGetGqlTypeByTypeId(attr.typeId) || _graphql.GraphQLString; | ||
const ReturnType = pgGetGqlTypeByTypeId(attr.typeId) || GraphQLString; | ||
addDataGenerator(parsedResolveInfoFragment => { | ||
@@ -92,3 +92,3 @@ const { alias } = parsedResolveInfoFragment; | ||
description: attr.description, | ||
type: nullableIf(!attr.isNotNull && !attr.type.domainIsNotNull, ReturnType), | ||
type: nullableIf(GraphQLNonNull, !attr.isNotNull && !attr.type.domainIsNotNull, ReturnType), | ||
resolve: (data, _args, _context, resolveInfo) => { | ||
@@ -99,3 +99,3 @@ const alias = getAliasFromResolveInfo(resolveInfo); | ||
}; | ||
}); | ||
}, { pgFieldIntrospection: attr }); | ||
return memo; | ||
@@ -108,3 +108,4 @@ }, {})); | ||
pgGetGqlInputTypeByTypeId, | ||
pgIntrospectionResultsByKind: introspectionResultsByKind | ||
pgIntrospectionResultsByKind: introspectionResultsByKind, | ||
graphql: { GraphQLString, GraphQLNonNull } | ||
} = build; | ||
@@ -130,3 +131,3 @@ const { | ||
description: attr.description, | ||
type: nullableIf(isPgPatch || !attr.isNotNull && !attr.type.domainIsNotNull || attr.hasDefault, pgGetGqlInputTypeByTypeId(attr.typeId) || _graphql.GraphQLString) | ||
type: nullableIf(GraphQLNonNull, isPgPatch || !attr.isNotNull && !attr.type.domainIsNotNull || attr.hasDefault, pgGetGqlInputTypeByTypeId(attr.typeId) || GraphQLString) | ||
}); | ||
@@ -133,0 +134,0 @@ return memo; |
@@ -54,6 +54,6 @@ "use strict"; | ||
const { | ||
scope: { isPgConnectionField, pgIntrospection: table }, | ||
scope: { isPgFieldConnection, pgFieldIntrospection: table }, | ||
addArgDataGenerator | ||
} = context; | ||
if (!isPgConnectionField || !table || table.kind !== "class" || !table.namespace) { | ||
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace) { | ||
return args; | ||
@@ -60,0 +60,0 @@ } |
@@ -12,6 +12,6 @@ "use strict"; | ||
builder.hook("GraphQLObjectType:fields:field:args", (args, { extend, getTypeByName, graphql: { GraphQLInt } }, { | ||
scope: { isPgConnectionField, pgIntrospection: source }, | ||
scope: { isPgFieldConnection, pgFieldIntrospection: source }, | ||
addArgDataGenerator | ||
}) => { | ||
if (!isPgConnectionField || !source || source.kind !== "class" && source.kind !== "procedure") { | ||
if (!isPgFieldConnection || !source || source.kind !== "class" && source.kind !== "procedure") { | ||
return args; | ||
@@ -18,0 +18,0 @@ } |
@@ -41,6 +41,6 @@ "use strict"; | ||
builder.hook("GraphQLObjectType:fields:field:args", (args, { extend, getTypeByName, pgGetGqlTypeByTypeId, pgSql: sql }, { | ||
scope: { isPgConnectionField, pgIntrospection: table }, | ||
scope: { isPgFieldConnection, pgFieldIntrospection: table }, | ||
addArgDataGenerator | ||
}) => { | ||
if (!isPgConnectionField || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) { | ||
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) { | ||
return args; | ||
@@ -47,0 +47,0 @@ } |
@@ -27,2 +27,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgConnectionTotalCountField: true | ||
}) | ||
@@ -29,0 +31,0 @@ }); |
@@ -107,2 +107,4 @@ "use strict"; | ||
}; | ||
}, { | ||
pgFieldIntrospection: constraint | ||
}); | ||
@@ -109,0 +111,0 @@ return memo; |
@@ -159,2 +159,5 @@ "use strict"; | ||
}; | ||
}, { | ||
pgFieldIntrospection: table, | ||
isPgCreateMutationField: true | ||
}); | ||
@@ -161,0 +164,0 @@ return memo; |
@@ -69,2 +69,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgMutationPayloadEdgeField: true, | ||
pgFieldIntrospection: table | ||
}) | ||
@@ -71,0 +74,0 @@ }); |
@@ -205,3 +205,5 @@ "use strict"; | ||
memo[fieldName] = fieldWithHooks(fieldName, context => { | ||
const { getDataFromParsedResolveInfoFragment } = context; | ||
const { | ||
getDataFromParsedResolveInfoFragment | ||
} = context; | ||
return { | ||
@@ -234,2 +236,6 @@ description: mode === "update" ? `Updates a single \`${tableTypeName}\` using its globally unique id and a patch.` : `Deletes a single \`${tableTypeName}\` using its globally unique id.`, | ||
}; | ||
}, { | ||
isPgNodeMutation: true, | ||
pgFieldIntrospection: table, | ||
[mode === "update" ? "isPgUpdateMutationField" : "isPgDeleteMutationField"]: true | ||
}); | ||
@@ -279,3 +285,5 @@ } | ||
memo[fieldName] = fieldWithHooks(fieldName, context => { | ||
const { getDataFromParsedResolveInfoFragment } = context; | ||
const { | ||
getDataFromParsedResolveInfoFragment | ||
} = context; | ||
return { | ||
@@ -293,2 +301,6 @@ description: mode === "update" ? `Updates a single \`${tableTypeName}\` using a unique key and a patch.` : `Deletes a single \`${tableTypeName}\` using a unique key.`, | ||
}; | ||
}, { | ||
isPgNodeMutation: false, | ||
pgFieldIntrospection: table, | ||
[mode === "update" ? "isPgUpdateMutationField" : "isPgDeleteMutationField"]: true | ||
}); | ||
@@ -295,0 +307,0 @@ }); |
@@ -77,2 +77,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgRowByUniqueConstraintField: true, | ||
pgFieldIntrospection: constraint | ||
}); | ||
@@ -79,0 +82,0 @@ }); |
@@ -118,2 +118,5 @@ "use strict"; | ||
}; | ||
}, { | ||
isPgNodeQuery: true, | ||
pgFieldIntrospection: table | ||
}); | ||
@@ -120,0 +123,0 @@ } |
@@ -53,2 +53,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isCursorField: true | ||
}), | ||
@@ -55,0 +57,0 @@ node: { |
@@ -181,2 +181,4 @@ "use strict"; | ||
}; | ||
}, { | ||
isCursorField: true | ||
}), | ||
@@ -183,0 +185,0 @@ node: { |
@@ -224,3 +224,7 @@ "use strict"; | ||
B: () => _graphql.GraphQLBoolean, | ||
N: () => _graphql.GraphQLFloat, | ||
// Numbers may be too large for GraphQL/JS to handle, so stringify by | ||
// default. | ||
N: () => _graphql.GraphQLString, | ||
A: type => new _graphql.GraphQLList(enforceGqlTypeByPgType(pgTypeById[type.arrayItemTypeId])) | ||
@@ -282,3 +286,7 @@ }; | ||
"23": _graphql.GraphQLInt, // int4 | ||
"700": _graphql.GraphQLFloat, // float4 | ||
"701": _graphql.GraphQLFloat, // float8 | ||
"1700": _graphql.GraphQLString, // numeric | ||
"790": _graphql.GraphQLFloat, // money | ||
"1186": GQLInterval, // interval | ||
@@ -290,5 +298,9 @@ "1082": SimpleDate, // date | ||
"1266": SimpleTime, // timetz | ||
"114": SimpleJSON, // json | ||
"3802": SimpleJSON, // jsonb | ||
"2950": SimpleUUID // uuid | ||
"2950": SimpleUUID, // uuid | ||
"1560": _graphql.GraphQLString, // bit | ||
"1562": _graphql.GraphQLString // varbit | ||
}, pgExtendedTypes && { | ||
@@ -295,0 +307,0 @@ "114": _graphqlTypeJson2.default, |
{ | ||
"name": "graphile-build-pg", | ||
"version": "0.1.0-alpha.35", | ||
"version": "0.1.0-alpha.36", | ||
"description": "Build a GraphQL schema by reflection over a PostgreSQL schema. Easy to customize since it's built with plugins on graphile-build", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"debug": ">=2 <3", | ||
"graphile-build": "0.1.0-alpha.32", | ||
"graphile-build": "^0.1.0-alpha.36", | ||
"graphql-iso-date": "^3.2.0", | ||
@@ -49,3 +49,4 @@ "graphql-type-json": "^0.1.4", | ||
"pg-sql2": "^1.0.0-beta.3", | ||
"pluralize": "^5.0.0" | ||
"pluralize": "^5.0.0", | ||
"postgres-interval": "1.1.1" | ||
}, | ||
@@ -52,0 +53,0 @@ "peerDependencies": { |
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
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
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
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
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
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1464385
10117
14
+ Addedpostgres-interval@1.1.1
+ Addedgraphile-build@0.1.0-alpha.39(transitive)
+ Addedpostgres-interval@1.1.1(transitive)
- Removedgraphile-build@0.1.0-alpha.32(transitive)
- Removedpostgres-interval@1.2.0(transitive)