Skip to content

Simplify withRequiredFields #166

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

Merged
merged 2 commits into from
Jun 2, 2025
Merged

Simplify withRequiredFields #166

merged 2 commits into from
Jun 2, 2025

Conversation

BoD
Copy link
Collaborator

@BoD BoD commented May 30, 2025

No description provided.

selections = fieldNamesToAddInInlineFragment.map { buildField(it) },
directives = emptyList(),
sourceLocation = null,
return if (isRoot) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Somewhat of a style issue but given the other part of this branch is very short, I would go for the early return here:

    if (!isRoot) {
      return newSelections
    }

    // go on with the regular stuff    

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, nicer.

@BoD BoD merged commit 7f1c5e1 into main Jun 2, 2025
2 checks passed
@BoD BoD deleted the simplify-with-required-fields branch June 2, 2025 08:01
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.

2 participants