-
-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Earlier I was trying to use Array/List constraints but run into a problem. It works with scalar but not with objects.
input TestInput {
id: ID!
arrInt: [Int!] @constraint(minLength: 1) # works
arrString: [String!] @constraint(minLength: 1) # works
arrObj: [TestInputObj!] @constraint(minLength: 1) # doesn't work, crash
}
The documentation is not really clear if it's a design limitation, nothing specific it should only works on list of scalar.
Stacktrace
TypeError: Cannot read properties of undefined (reading 'toString')
at getScalarType (/app/node_modules/graphql-constraint-directive/lib/type-utils.js:52:61)
at getScalarType (/app/node_modules/graphql-constraint-directive/lib/type-utils.js:50:17)
at getScalarType (/app/node_modules/graphql-constraint-directive/lib/type-utils.js:46:17)
at wrapType (/app/node_modules/graphql-constraint-directive/index.js:64:20)
at MapperKind.FIELD (/app/node_modules/graphql-constraint-directive/index.js:82:11)
at mapFields (/app/node_modules/graphql-constraint-directive/node_modules/@graphql-tools/utils/cjs/mapSchema.js:144:37)
at mapSchema (/app/node_modules/graphql-constraint-directive/node_modules/@graphql-tools/utils/cjs/mapSchema.js:10:37)
at /app/node_modules/graphql-constraint-directive/index.js:77:5
at eval (/app/apps/api/src/schema/index.ts:81:89)
dt-hugues-lerebours
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request