Fork me on GitHub
#graphql
<
2017-12-12
>
guy21:12:49

Hi a bit of a funny question

guy21:12:52

{
    "errors": [
        {
            "message": "Additional data must be non-nil."
        }
    ]
}

guy21:12:08

I get this error message when i send a nil as part of a variables map

guy21:12:28

but i cant actually see where that error is made in the lacinia lib

admay22:12:08

@guy can you post your query/mutation and any relevant schema?

guy22:12:53

i know what causes it

guy22:12:50

:name {:type (non-null String)} as part of an input object

guy22:12:15

let me make a shortened version

guy22:12:01

quick and dirty mutation im doing via postman

guy22:12:04

{"query":"mutation create_error($test_args: CreateErrorInput!) {
  create_error(test_args: $test_args) {
  	name
  	other
  }}",

   "variables":{
   	"test_args": {
   		"name": null,
   		"other": "a string"
   		}}}

guy22:12:31

:mutations     {:create_error     {:type :Test
                                    :args {:test_args {:type (non-null :CreateErrorInput)}}
                                    :resolve :resolve-create-error}}

guy22:12:37

a example mutation

guy22:12:50

:CreateErrorInput {:fields {:name {:type (non-null String)}
                                             :other {:type String}}}

guy22:12:07

:Test {:fields {:name {:type (non-null String)}
                                 :other {:type String}}}

guy22:12:13

The issue isnt whats causing it

guy22:12:25

I want to know what in the lacinia lib creates this message

guy22:12:33

{
    "errors": [
        {
            "message": "Additional data must be non-nil."
        }
    ]
}

guy22:12:44

I know that name is null because i set it

guy22:12:12

I just did a quick search of lacinia via github and couldnt find it thats all

guy22:12:37

I’m just curious is all

hlship23:12:08

There's a bug, fixed in head, where (ex-info) may get called with a nil ex data. The message you see is inside ExceptionInfo.java.

hlship23:12:31

That's a bad thing, a second-order exception that obscures the original exception.