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

Ways to modify a result of a more high-level resolver #3635

Open
asp3cto opened this issue Apr 3, 2025 · 0 comments
Open

Ways to modify a result of a more high-level resolver #3635

asp3cto opened this issue Apr 3, 2025 · 0 comments

Comments

@asp3cto
Copy link

asp3cto commented Apr 3, 2025

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.

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

No branches or pull requests

1 participant