Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add option to mute suggestions during query/mutation validation #119

Closed
carstendietrich opened this issue Aug 8, 2024 · 1 comment
Closed

Comments

@carstendietrich
Copy link
Member

Add option to mute suggestions in validation errors.

potential way:

module.go

gqlHandler.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response {
		gqlErrors := graphql.GetErrors(ctx)
		if gqlErrors == nil {
			return next(ctx)
		}
		
		if !strings.Contains(gqlErrors.Error(),"Did you mean") {
			return next(ctx)
		}
		
		resp := next(ctx)
		// modify resp to drop everything after did you mean..
		
		return resp
	})
carstendietrich pushed a commit that referenced this issue Sep 18, 2024
---------

Co-authored-by: Kirill Grigorev <kirill.grigorev@omnevo.net>
@carstendietrich
Copy link
Member Author

Type hints are muted by default. Will be resolved with next release. Closing this one.

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

No branches or pull requests

1 participant