Angular template: problems with fragments
See original GitHub issueHi,
I found two problems with fragments for the Angular template. This is an extract of the generated code:
const InvoiceCheckResultFragment = gql`
fragment InvoiceCheckResult on InvoiceCheckResult {
rowsWithUnknownProductCodes
unknownShippings {
...InvoiceShipping
}
shippingsThatWereChargedMultipleTimes
shippings {
...InvoiceShipping
}
}
${InvoiceShippingFragment}
${InvoiceShippingFragment}
`;
...
const InvoiceShippingFragment = gql`
fragment InvoiceShipping on InvoiceShipping {
rowsWithUnknownProductCodes
invoiceNumber
....
The first one is the same one that you have fixed in #591 for react (fragment definition order). TypeScript spits out the error
error TS2448: Block-scoped variable 'InvoiceShippingFragment' used before its declaration.
The second problem is that fragments that are referenced twice are included twice in the gql-string. In this case, this is InvoiceShippingFragment.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Angular, <template> element and #document-fragment
ngNonBindable on the <template> element or the <img> element seems to have no effect. I am using Angular 10. I need to do...
Read more >Component View-Template Fragments Retain Bindings And ...
Component View-Template Fragments Retain Bindings And Can Be Moved Around In The DOM In Angular 9.0.0-rc.2. By Ben Nadel on November 17, ...
Read more >Understanding templates - Angular
In Angular, a template is a blueprint for a fragment of a user interface (UI). Templates are written in HTML, and special syntax...
Read more >How to include a fragment in an Angular dialog - OpenMRS Talk
Q: Any idea how I can include a fragment in my ngDialog ? Note: Iit is also possible to provide the template as...
Read more >Passing pieces of markup to components in Angular 2 and ...
Passing pieces of markup to components in Angular 2 and problems with dynamic ... Template reference variables is just a convenient way of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tested it -> fixed 😃 Thanks a lot!
Fixed in 0.12.3 😃