-
Notifications
You must be signed in to change notification settings - Fork 189
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
PDE-4685 feat(core,schema): allow to set primary
for outputFields
#754
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough job.
return true; | ||
} else { | ||
hasPrimary = true; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the loop is yet to process the id
field with primary set? I don't think the outputFields is always sorted to start with the id
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Reverted the change and added a test in 7f5ef17. Thanks!
After this PR, a developer can define which output field(s) to be the primary key of an output item. For example:
will tell Zapier to dedupe polling trigger results using the unique hash of
(authorId, name)
.If no output fields are set as
primary
, the field with the keyid
will be as the primary key for deduplication. This is the same as the current behavior.