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

fix : returning error instead of *gqlError.Error #234

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

schafle
Copy link
Contributor

@schafle schafle commented Aug 25, 2022

Related Issue:

#99

Background

gqlparser functions are returning nil but the return type is *gqlrrror.Error.

This is how the code looks like before my change: https://github.com/vektah/gqlparser/blob/master/parser/schema.go#L9

func ParseSchema(source *Source) (*SchemaDocument, *gqlerror.Error) {
   .
   .
   .
	return ast, nil
}

The problem is while using this code, err != nil doesn't work since err is actually not nil it is zero value *gqlerror.Error.

The issue had been raised in the past: #99 and they also had a PR for fix #100 which then was closed by author themself.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 88.562% when pulling f840275 on schafle:gqlerr_to_error into 6d97050 on vektah:master.

Copy link
Collaborator

@StevenACoffman StevenACoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a very positive change, but given the change to function signatures, I'm wondering if @a8m @giautm and others have thoughts on how to release this. We are currently at v2.4.8, so I wonder if v2.5.0 might be enough of a signal or if we need to go with v3.0.0?

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 this pull request may close these issues.

None yet

3 participants