-
-
Notifications
You must be signed in to change notification settings - Fork 798
Labels
Area: Type SystemIssue is related to the Type SystemIssue is related to the Type System🌶️ hot chocolate
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
In contrast to V11 a mutation fails if an optional input field is not set and the field is mapped to a non nullable property.
Steps to reproduce
- Checkout and start https://github.com/svelue/OptionalInputBug
- Run
mutation{ addBook(book: {title: "123", someNumber: 1}){ title someNumber } }
--> it works - Run
mutation{ addBook(book: {title: "123"}){ title someNumber } }
--> it fails
Relevant log output
+ "Message": "Unexpected Execution Error",
+ "Code": null,
+ "Path": {
+ "Parent": null,
+ "Depth": 0,
+ "Name": "sendData"
+ },
+ "Locations": [
+ {
+ "Line": 2,
+ "Column": 3
+ }
+ ],
+ "Extensions": null,
+ "Exception": {
+ "ClassName": "System.NullReferenceException",
+ "Message": "Object reference not set to an instance of an object.",
+ "Data": null,
+ "InnerException": null,
+ "HelpURL": null,
+ "StackTraceString": " at lambda_method858(Closure , Object[] )\r\n at HotChocolate.Types.InputParser.ParseObject(IValueNode resultValue, InputObjectType type, Path path, Int32 stack, Boolean defaults)\r\n at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputField field)\r\n at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputField field)\r\n at HotChocolate.Types.InputParser.ParseList(IValueNode resultValue, ListType type, Path path, Int32 stack, Boolean defaults, IInputField field)\r\n at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputField field)\r\n at HotChocolate.Types.InputParser.ParseLiteral(IValueNode value, IInputField field, Type targetType)\r\n at HotChocolate.Execution.Processing.MiddlewareContext.CoerceArgumentValue[T](ArgumentValue argument)\r\n at HotChocolate.Execution.Processing.MiddlewareContext.ArgumentValue[T](NameString name)\r\n at HotChocolate.Execution.Processing.DirectiveContext.ArgumentValue[T](NameString name)\r\n at lambda_method1081(Closure , IResolverContext )\r\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<<CreateResolverMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at HotChocolate.AspNetCore.Authorization.AuthorizeMiddleware.InvokeAsync(IDirectiveContext context)\r\n at HotChocolate.Utilities.MiddlewareCompiler`1.ExpressionHelper.AwaitTaskHelper(Task task)\r\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)\r\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)",
+ "RemoteStackTraceString": null,
+ "RemoteStackIndex": 0,
+ "ExceptionMethod": null,
+ "HResult": -2147467261,
+ "Source": "Anonymously Hosted DynamicMethods Assembly",
+ "WatsonBuckets": null
+ },
Additional Context?
https://hotchocolategraphql.slack.com/archives/CD9TNKT8T/p1635433560328800
Product
Hot Chocolate
Version
12.0.1
Metadata
Metadata
Assignees
Labels
Area: Type SystemIssue is related to the Type SystemIssue is related to the Type System🌶️ hot chocolate