question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add typescript definitions

See original GitHub issue

For now, in some use cases, TS (in atom) warns: Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'string'. for using gql like this:

gql` ... `

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
stubailocommented, Jul 18, 2016

Publishing now!

2reactions
philcockfieldcommented, Jul 14, 2016

@stubailo - I suspect this would do the trick:

index.d.ts

import { Document } from 'graphql';
export default function gql(literals: Array<string>, ...placeholders: Array<string>): Document;


Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: Adding Custom Type Definitions for Existing ...
In these circumstances, you have to add your own custom type definitions for the libraries. This article will show you how to that....
Read more >
Documentation - Type Declarations - TypeScript
TypeScript automatically finds type definitions under node_modules/@types , so there's no other step needed to get these types available in your program.
Read more >
Add your own Type Definition to any Javascript 3rd party module
1. To the typeRoots property add your local-types folder path. "compilerOptions" : { ... "typeRoots": [ "node_modules/@types", · 2. Add a paths ...
Read more >
How to add custom types into the TypeScript project - drag13.io
Create custom typings · Create a root folder for your types. You can give any name for it but let it be types...
Read more >
Adding Custom Type Definitions to a Third-Party Library
If you've done this, you may quickly find out that if you are using TypeScript with your app, there are a lot of...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found