gqlgen
gqlgen copied to clipboard
Ways to modify a result of a more high-level resolver
I have something like this in my schema
type Query {
request: QueryMessageOt!
}
type QueryMessageOt {
requestID: ID!
offline: Boolean!
executionTime: Float
cargo(filter: CargoFilterIt!, cursor: String, limit: Int): CargoResult
}
How can i modify root fields in my cargo resolver? For example, i want to accumulate the execution time, but when i do this:
func (r *queryMessageOtResolver) Cargo(ctx context.Context, obj *model.QueryMessageOt, filter model.CargoFilterIt, cursor *string, limit *int) (*model.CargoResult, error) {
*obj.ExecutionTime += 777.0
return nil, nil
}
i still get old execution time from request resolver.