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

Move partition instruction to Blueprint #597

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

felipe-gdr
Copy link
Contributor

2 benefits out of this:

  • we move part of the computation out of request processing
  • don't rely on overallField.getFieldDefinitions() calls in the transform, which can cause problems when used in conjunction with hydrations and renames

// We can't partition a field that has multiple partition instructions in different types
if (partitionInstructions.size != 1) {
// TODO add validation to ensure @partition is not used in a way that would result in a ENF to have multiple partition instructions
return null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

another improvement introduced in this PR: don't call getFieldPartitionContext for fields that don't have @partition

location = makeFieldCoordinates(parentType, field),
pathToPartitionArg = partitionDefinition.pathToSplitPoint,
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this store more info like whether the output type is Payload like? etc.

Though maybe leave the changes here minimal because I'm exploring merging validation & blueprint code together in another branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. All this static information should live in the Blueprint.
I'll wait for your refactor to make the change.

@felipe-gdr felipe-gdr merged commit a193ba0 into master Oct 21, 2024
2 checks passed
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