mercurius-validation
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -23,5 +23,10 @@ 'use strict' | ||
const items = { ...builtValidationSchema.items, $ref: `https://mercurius.dev/validation/${namedType.name}` } | ||
builtValidationSchema = { ...builtValidationSchema, type: 'array', items } | ||
builtValidationSchema = { ...builtValidationSchema, type: 'array', items, nullable: !isNonNull } | ||
} else { | ||
builtValidationSchema = { ...builtValidationSchema, type: 'object', $ref: `https://mercurius.dev/validation/${namedType.name}` } | ||
builtValidationSchema = { | ||
...builtValidationSchema, | ||
type: 'object', | ||
$ref: `https://mercurius.dev/validation/${namedType.name}`, | ||
nullable: !isNonNull | ||
} | ||
} | ||
@@ -34,3 +39,3 @@ // If we have an array of scalars, set the array type and infer the items | ||
} | ||
builtValidationSchema = { ...builtValidationSchema, type: 'array', items } | ||
builtValidationSchema = { ...builtValidationSchema, type: 'array', items, nullable: !isNonNull } | ||
} | ||
@@ -111,2 +116,3 @@ | ||
type: 'object', | ||
nullable: true, | ||
properties: {} | ||
@@ -113,0 +119,0 @@ } |
{ | ||
"name": "mercurius-validation", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Mercurius Validation Plugin adds configurable Validation support to Mercurius.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -190,3 +190,4 @@ 'use strict' | ||
type: ['string', 'null'] | ||
} | ||
}, | ||
nullable: true | ||
}, | ||
@@ -228,3 +229,4 @@ data: [] | ||
type: ['string', 'null'] | ||
} | ||
}, | ||
nullable: true | ||
}, | ||
@@ -250,3 +252,4 @@ data: [ | ||
$ref: 'https://mercurius.dev/validation/ArrayFilters' | ||
} | ||
}, | ||
nullable: true | ||
}, | ||
@@ -559,3 +562,4 @@ data: [] | ||
type: ['string', 'null'] | ||
} | ||
}, | ||
nullable: true | ||
}, | ||
@@ -581,3 +585,4 @@ data: [ | ||
$ref: 'https://mercurius.dev/validation/ArrayFilters' | ||
} | ||
}, | ||
nullable: true | ||
}, | ||
@@ -584,0 +589,0 @@ data: [] |
@@ -103,3 +103,11 @@ 'use strict' | ||
} | ||
messages(filters: { text: "hello"}, nestedFilters: { input: { text: "hello"} }) { | ||
messages( | ||
filters: { text: "hello"}, | ||
nestedFilters: { input: { text: "hello"} }, | ||
arrayScalarFilters: ["hello"], | ||
arrayObjectFilters: [{ | ||
values: ["hello"] | ||
filters: [{ text: "hello" }] | ||
}] | ||
) { | ||
id | ||
@@ -461,2 +469,3 @@ text | ||
}, | ||
nullable: true, | ||
minItems: 2 | ||
@@ -561,2 +570,3 @@ }, | ||
}, | ||
nullable: true, | ||
minItems: 2 | ||
@@ -774,3 +784,4 @@ }, | ||
type: 'string' | ||
} | ||
}, | ||
nullable: false | ||
}, | ||
@@ -796,2 +807,3 @@ data: [ | ||
}, | ||
nullable: false, | ||
minItems: 2 | ||
@@ -965,2 +977,3 @@ }, | ||
type: 'object', | ||
nullable: true, | ||
properties: { | ||
@@ -1050,2 +1063,3 @@ text: { | ||
type: 'object', | ||
nullable: true, | ||
properties: { | ||
@@ -1362,2 +1376,3 @@ text: { | ||
}, | ||
nullable: true, | ||
minItems: 2 | ||
@@ -1602,2 +1617,3 @@ }, | ||
}, | ||
nullable: true, | ||
minItems: 2 | ||
@@ -1843,2 +1859,3 @@ }, | ||
}, | ||
nullable: true, | ||
minItems: 2 | ||
@@ -2073,5 +2090,18 @@ }, | ||
app.register(mercurius, { | ||
schema: `type Query { | ||
nullableInput(input: String): String | ||
}`, | ||
schema: ` | ||
input TestObject { | ||
value: Float! | ||
} | ||
type Query { | ||
nullableInput( | ||
stringInput: String, | ||
floatInput: Float, | ||
intInput: Int, | ||
objectInput: TestObject, | ||
arrayInput: [String!], | ||
objectArrayInput: [TestObject!] | ||
): String | ||
} | ||
`, | ||
resolvers: { | ||
@@ -2088,3 +2118,10 @@ Query: { | ||
const query = `query { | ||
nullableInput(input: null) | ||
nullableInput( | ||
stringInput: null, | ||
floatInput: null, | ||
intInput: null, | ||
objectInput: null, | ||
arrayInput: null, | ||
objectArrayInput: null | ||
) | ||
}` | ||
@@ -2091,0 +2128,0 @@ |
Sorry, the diff of this file is too big to display
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
313895
9288