You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to switch to the transformer I've ran into an issue; say:
const a = gql`
fragment a on A {
id
}
`
const b = gql`
fragment b on B {
id
child {
...a
}
}
${a}
`
const c = gql`
fragment c on C {
id
childA { ...a }
childB { ...b }
}
${a}
${b}
`
Now the c fragment basically embeds a twice. Once itself, once via b. graphql-tag handles this on runtime and does not embed the duplicate. However the compile time transformation follows a twice. Causing a query error.
I'm not familiar with the ts visitor api but I guess it could be possible to find duplicate references in a single interpolation tree and skip duplicates. Is it possible or does it require some runtime knowledge?
Thanks!
The text was updated successfully, but these errors were encountered:
This requires the context of interpolation.
Regrettably, I have no free time to do this improvement recently :(
I marked the issue as help wanted and kept it open.
Hi,
While trying to switch to the transformer I've ran into an issue; say:
Now the c fragment basically embeds
a
twice. Once itself, once viab
.graphql-tag
handles this on runtime and does not embed the duplicate. However the compile time transformation followsa
twice. Causing a query error.I'm not familiar with the ts visitor api but I guess it could be possible to find duplicate references in a single interpolation tree and skip duplicates. Is it possible or does it require some runtime knowledge?
Thanks!
The text was updated successfully, but these errors were encountered: