@platformatic/sql-graphql
Advanced tools
Comparing version 0.20.1 to 0.21.0
@@ -102,23 +102,35 @@ 'use strict' | ||
const whereFields = Object.keys(fields).reduce((acc, field) => { | ||
acc[field] = { | ||
type: new graphql.GraphQLInputObjectType({ | ||
name: `${entityName}WhereArguments${field}`, | ||
fields: { | ||
eq: { type: fields[field].type }, | ||
neq: { type: fields[field].type }, | ||
gt: { type: fields[field].type }, | ||
gte: { type: fields[field].type }, | ||
lt: { type: fields[field].type }, | ||
lte: { type: fields[field].type }, | ||
like: { type: fields[field].type }, | ||
in: { type: new graphql.GraphQLList(fields[field].type) }, | ||
nin: { type: new graphql.GraphQLList(fields[field].type) } | ||
} | ||
}) | ||
} | ||
return acc | ||
}, {}) | ||
const whereArgType = new graphql.GraphQLInputObjectType({ | ||
name: `${entityName}WhereArguments`, | ||
fields: Object.keys(fields).reduce((acc, field) => { | ||
acc[field] = { | ||
type: new graphql.GraphQLInputObjectType({ | ||
name: `${entityName}WhereArguments${field}`, | ||
fields: { | ||
...whereFields, | ||
or: { | ||
type: new graphql.GraphQLList(new graphql.GraphQLInputObjectType({ | ||
name: `${entityName}WhereArgumentsOr`, | ||
fields: { | ||
eq: { type: fields[field].type }, | ||
neq: { type: fields[field].type }, | ||
gt: { type: fields[field].type }, | ||
gte: { type: fields[field].type }, | ||
lt: { type: fields[field].type }, | ||
lte: { type: fields[field].type }, | ||
like: { type: fields[field].type }, | ||
in: { type: new graphql.GraphQLList(fields[field].type) }, | ||
nin: { type: new graphql.GraphQLList(fields[field].type) } | ||
...whereFields | ||
} | ||
}) | ||
})) | ||
} | ||
return acc | ||
}, {}) | ||
} | ||
}) | ||
@@ -125,0 +137,0 @@ |
@@ -22,3 +22,3 @@ 'use strict' | ||
case 'decimal': | ||
return graphql.GraphQLInt | ||
return graphql.GraphQLString | ||
case 'bigint': | ||
@@ -47,3 +47,3 @@ return graphql.GraphQLString | ||
case 'numeric': | ||
return graphql.GraphQLFloat | ||
return graphql.GraphQLString | ||
case 'float4': | ||
@@ -50,0 +50,0 @@ return graphql.GraphQLFloat |
{ | ||
"name": "@platformatic/sql-graphql", | ||
"version": "0.20.1", | ||
"version": "0.21.0", | ||
"description": "Map SQL dbs to GraphQL", | ||
@@ -24,4 +24,4 @@ "main": "index.js", | ||
"ws": "^8.12.1", | ||
"@platformatic/sql-events": "0.20.1", | ||
"@platformatic/sql-mapper": "0.20.1" | ||
"@platformatic/sql-events": "0.21.0", | ||
"@platformatic/sql-mapper": "0.21.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "dependencies": { |
@@ -61,3 +61,3 @@ 'use strict' | ||
aSmallint: 42, | ||
aDecimal: 42, | ||
aDecimal: "42", | ||
anEnum: value1 | ||
@@ -96,3 +96,3 @@ }) { | ||
aSmallint: 42, | ||
aDecimal: 42, | ||
aDecimal: '42', | ||
anEnum: 'value1' | ||
@@ -308,3 +308,3 @@ } | ||
aSmallint: 42, | ||
aDecimal: 42, | ||
aDecimal: "42", | ||
anEnum: value1 | ||
@@ -343,3 +343,3 @@ }) { | ||
aSmallint: 42, | ||
aDecimal: 42, | ||
aDecimal: '42', | ||
anEnum: 'value1' | ||
@@ -390,3 +390,3 @@ } | ||
aSmallint: 42, | ||
aDecimal: 42, | ||
aDecimal: '42', | ||
anEnum: 'value1' | ||
@@ -554,3 +554,3 @@ } | ||
aSmallint: 42, | ||
aDecimal: 42 }) { | ||
aDecimal: "42" }) { | ||
id | ||
@@ -582,3 +582,3 @@ published | ||
aSmallint: 42, | ||
aDecimal: 42 | ||
aDecimal: '42' | ||
} | ||
@@ -623,3 +623,3 @@ } | ||
aSmallint: 42, | ||
aDecimal: 42 | ||
aDecimal: '42' | ||
} | ||
@@ -626,0 +626,0 @@ } |
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
271508
36
10637