You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in generated.go contains unused parameters that triggers warnings in vscode (e.g. "unused parameter: ctx"). For example, generated.go produces code like this:
func (ec*executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc*graphql.FieldContext, errerror) {
fc=&graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switchfield.Name {
case"id":
returnec.fieldContext_Todo_id(ctx, field)
case"text":
returnec.fieldContext_Todo_text(ctx, field)
case"done":
returnec.fieldContext_Todo_done(ctx, field)
case"user":
returnec.fieldContext_Todo_user(ctx, field)
}
returnnil, fmt.Errorf("no field named %q was found under type Todo", field.Name)
},
}
returnfc, nil
}
What did you expect?
Generated code not to trigger warnings.
Minimal graphql.schema and models to reproduce
Running the gqlgen-todos quickstart example produces code that triggers the unused parameter warnings.
versions
go run github.com/99designs/gqlgen version? 0.17.45
go version? 1.21.6
The text was updated successfully, but these errors were encountered:
What happened?
The code in
generated.go
contains unused parameters that triggers warnings in vscode (e.g. "unused parameter: ctx"). For example,generated.go
produces code like this:What did you expect?
Generated code not to trigger warnings.
Minimal graphql.schema and models to reproduce
Running the gqlgen-todos quickstart example produces code that triggers the unused parameter warnings.
versions
go run github.com/99designs/gqlgen version
? 0.17.45go version
? 1.21.6The text was updated successfully, but these errors were encountered: