-
-
Notifications
You must be signed in to change notification settings - Fork 241
Closed
Description
https://github.com/darkbasic/nativescript-repro1/blob/master/app/item/item.service.ts
const taggedTemplateLiteralDoesNotWorkHere = gql`
query GetChats($amount: Int) {
chats {
id
messages(amount: $amount) {
id
}
}
}
`;
gql tagged template literals don't work in Nativescript, unless you put them inside a class:
@Injectable()
export class ItemService {
theSameTaggedTemplateLiteralWorksHere = gql`
query GetChats($amount: Int) {
chats {
id
messages(amount: $amount) {
id
}
}
}
`;
}
If I use gql
as a function instead of a tagged template literal it works fine everywhere:
const callingItAsFunctionWorksFine = gql(`
query GetChats($amount: Int) {
chats {
id
messages(amount: $amount) {
id
}
}
}
`);
Full Error: http://paste.ubuntu.com/p/SMKyCvGkdW/
I thought it could have been an issue with Typescript's cache (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-6.html), but I get the same issue with Typescript 2.6, 2.6 and 2.7.
Metadata
Metadata
Assignees
Labels
No labels