Where the mutation body uses and declares a fragment named the same as one found in an active selection it was incorrectly added as duplicate. This change checks the document for existing named fragments before adding them.
Given a query
query {
todos {
...TodoFragment
creator {
...CreatorFragment
}
}
}
fragment TodoFragment on Todo {
id
text
}
fragment CreatorFragment on User {
id
name
}
and mutation using both @populate and a named fragment
mutation MyMutation {
addTodo @populate
...TodoFragment
}
}
fragment TodoFragment on Todo {
id
text
}
The TodoFragment should appear only once in the populated mutation.
Additional changes
Renamed some variables for clarity
Moved the snapshots to inline for ease of readability. Reviewers may find it simpler to step through commits.
Where the mutation body uses and declares a fragment named the same as one found in an active selection it was incorrectly added as duplicate. This change checks the document for existing named fragments before adding them.
Given a query
and mutation using both
@populate
and a named fragmentThe
TodoFragment
should appear only once in the populated mutation.Additional changes