Skip to content
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

InvalidNullError docs for value attribute #5243

Closed
ravangen opened this issue Feb 19, 2025 · 2 comments · Fixed by #5256
Closed

InvalidNullError docs for value attribute #5243

ravangen opened this issue Feb 19, 2025 · 2 comments · Fixed by #5256

Comments

@ravangen
Copy link
Contributor

Describe the bug

When can InvalidNullError return ExecutionError for value?

# @return [nil, GraphQL::ExecutionError] The invalid value for this field
attr_reader :value

Steps to reproduce

Looks to only be set here

case value
when nil
if is_non_null
set_result(selection_result, result_name, nil, false, is_non_null) do
# When this comes from a list item, use the parent object:
parent_type = selection_result.is_a?(GraphQLResultArray) ? selection_result.graphql_parent.graphql_result_type : selection_result.graphql_result_type
# This block is called if `result_name` is not dead. (Maybe a previous invalid nil caused it be marked dead.)
err = parent_type::InvalidNullError.new(parent_type, field, value)

Expected behavior

 # @return [nil] The invalid value for this field 
 attr_reader :value 

At which point, we might as well drop the attribute entirely?

@rmosolgo
Copy link
Owner

👍 LGTM. Probably the implementation changed over the years, but that (nine-year-old!) doc comment wasn't updated.

@ravangen
Copy link
Contributor Author

Opened #5256 to resolve this feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants