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

fix op to rc in comment of FieldContext.Child #3333

Merged
merged 8 commits into from
Nov 1, 2024
Merged
4 changes: 2 additions & 2 deletions graphql/context_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type FieldContext struct {
//
// srv.AroundFields(func(ctx context.Context, next graphql.Resolver) (interface{}, error) {
// fc := graphql.GetFieldContext(ctx)
// op := graphql.GetOperationContext(ctx)
// collected := graphql.CollectFields(opCtx, fc.Field.Selections, []string{"User"})
// rc := graphql.GetOperationContext(ctx)
Copy link
Contributor Author

@s-ichikawa s-ichikawa Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there are some variations in the naming of the variable returned from graphql.GetOperationContext() (e.g., rc, opCtx, rctx) in gqlgen repository, but rc is the most common.

// collected := graphql.CollectFields(rc, fc.Field.Selections, []string{"User"})
//
// child, err := fc.Child(ctx, collected[0])
// if err != nil {
Expand Down
Loading