i-love-flamingo / graphql

Flamingo GraphQL Module
MIT License
5 stars 1 forks source link

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

Closed carstendietrich closed 3 weeks ago

carstendietrich commented 2 months ago

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 commented 3 weeks ago

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