graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

Typescript declarations

Open samrae7 opened this issue 9 years ago • 5 comments

Would a typescript declarations file be welcome as part of the project? I have looked for one online and so far can't find one. Would it be useful to submit one as a PR?

samrae7 avatar Oct 02 '17 14:10 samrae7

@samrae7 I don't see why not, but what's the purpose? Just wanted to understand more since I'm a complete TypeScript noob :D

asiandrummer avatar Oct 02 '17 21:10 asiandrummer

@asiandrummer thanks for the reply

On reflection the use case is limited, and even then I think someone could easily add the types themselves. It would be for people who want to add the graphiQL component to existing typescript projects, and then not have to declare eg. the prop type ( eg. fetcher: () => Promise) themselves. However, like I say people could add that quite easily themselves if they really needed to make it part of a ts project.

In any case I realised that for what I wanted it for, I could just have it as a separate js repo that I can fire up when I need it ( rather than adding it to the main app, which is written in ts). I think I will close this issue, as it makes sense why no one else has needed it up until now.

samrae7 avatar Oct 03 '17 10:10 samrae7

+1 for full typescript support.

AlexCppns avatar Apr 02 '19 17:04 AlexCppns

@samrae7 did you find any solution or tool that worked out for you? I'm actually in the same situation

diegoaguilar avatar Feb 18 '21 04:02 diegoaguilar

@diegoaguilar as of the latest release, all the packages in this repo are now all in typescript and have typescript declarations as well.

imolorhe avatar Feb 19 '21 00:02 imolorhe