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

Conversation

s-ichikawa
Copy link
Contributor

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: 59.229% (-0.02%) from 59.253%
when pulling 472150a on s-ichikawa:fix-comment
into f02c5b4 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
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.

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

@s-ichikawa
Copy link
Contributor Author

@StevenACoffman maybe I changed them all.

@StevenACoffman StevenACoffman merged commit 2076a17 into 99designs:master Nov 1, 2024
16 of 17 checks passed
@StevenACoffman
Copy link
Collaborator

Thanks so much! This has confused a number of people, so I appreciate you cleaning it up! Looking forward to future contributions from you!

@s-ichikawa s-ichikawa deleted the fix-comment branch November 1, 2024 15:19
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