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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

s-ichikawa
Copy link

Fixed the implementation in the comments.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@coveralls
Copy link

coveralls commented Oct 17, 2024

Coverage Status

coverage: 58.924%. remained the same
when pulling 68aa330 on s-ichikawa:fix-comment
into f9eac5c on 99designs:master.

@@ -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
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.

@StevenACoffman
Copy link
Collaborator

StevenACoffman commented Oct 27, 2024

Hey, I appreciate making things more consistent, but it feels unintuitive for the graphql.GetOperationContext(ctx) to be assigned to rc. If we have a mix, I would rather find the places we are currently using rc for this and change them to opCtx.

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

Successfully merging this pull request may close these issues.

3 participants