-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash while creating error message for type error in named query without operationName #142
Comments
Hi Bach,
Keep em coming! Just to let you know there are holidays over here at the
moment and hence people might not be that fast to answer right now. But
once the holidays are over, I'll get to look into all of these for real.
…On Thu, Dec 28, 2017 at 5:01 AM Bach Le ***@***.***> wrote:
That was a handful to type.
Basically, given a named query:
query FindSomething($input: Input!) {
find(input: $input)
}
$input contains a type error (e.g: negative number for a uint type).
operationName is not given by the client and following
graphql-erlang-tutorial, it is set to undefined.
Given this query, graphql will crash with:
#{class => error,
error => {case_clause,{undefined}},
module => my_web_handler_module,
stacktrace =>
[{graphql_err,'-path/1-F/1-0-',1,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_err.erl"},
{line,43}]},
{graphql_err,'-path/1-lc$^2/1-2-',2,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_err.erl"},
{line,60}]},
{graphql_err,path,1,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_err.erl"},
{line,60}]},
{graphql_err,mk,3,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_err.erl"},
{line,20}]},
{graphql_err,abort,3,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_err.erl"},
{line,16}]},
{graphql_type_check,check_input_object_fields,4,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_type_check.erl"},
{line,232}]},
{graphql_type_check,'-tc_params/3-fun-0-',4,
[{file,"/home/bullno1/Projects/nm-exchange-api/_build/default/lib/graphql/src/graphql_type_check.erl"},
{line,131}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1263}]}]}
Which I guess is while it's trying to build the error path, hence the
undefined case clause.
After I give operationName a correct value, graphql reports the type
error correctly without crashing.
GraphQL commit: 135657f
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#142>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAWHwTjAcA980VVLuQC6mRlDJyhWLpFks5tExKtgaJpZM4RN_ay>
.
|
This is definitely an oversight and needs a fix. |
jlouis
added a commit
that referenced
this issue
Jan 2, 2018
Handle undefined operations. Closes #142.
This should fix the problem in this Issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That was a handful to type.
Basically, given a named query:
$input
contains a type error (e.g: negative number for a uint type).operationName
is not given by the client and following graphql-erlang-tutorial, it is set toundefined
.Given this query, graphql will crash with:
Which I guess is while it's trying to build the error path, hence the
undefined
case clause.After I give
operationName
a correct value, graphql reports the type error correctly without crashing.GraphQL commit:
135657f745254198f3d07e35fd3a63623144b119
The text was updated successfully, but these errors were encountered: