-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Hi,
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!
talzion12
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed