-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GRAPHQL): fix duplicate xid error for multiple xid fields. (#7546)
We were getting duplicate xid error for the multiple xid fields if typeName+xidName+xidValue is same for those fields. The reason for this is that we need to generate unique query variables for the xids field while doing mutation rewriting and for that we use a map to variable names. we were using below key for that map key = typ.FieldOriginatedFrom(xidName) + xidName + xidVal This was generating same key for different xid fields. For example in below type we have two fields with id fields type ABC { ab: String! @id abc: String! @id } And below mutation try to set them such that key = typ.FieldOriginatedFrom(xidName) + xidName + xidVal will be same for both of them i.e. ABC+ab+cd=ABC+abc+d=ABCabcd mutation { addABC(input: [{ ab: "cd", abc: "d" }]) { aBC { ab abc } } } This error also occur in multiple types. We now added "." between values to separate typename and xidname , and the xidValue.This will ensure unique keys for xid fields across types. key = typ.FieldOriginatedFrom(xidName) + "." + xidName + "." + xidVal
- Loading branch information
1 parent
06922a1
commit 5c700d0
Showing
3 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters