-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript type safety #141
Typescript type safety #141
Conversation
@felixfbecker: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
@@ -20,7 +20,9 @@ | |||
"url": "https://github.com/apollostack/graphql-tag/issues" | |||
}, | |||
"homepage": "https://github.com/apollostack/graphql-tag#readme", | |||
"dependencies": {}, | |||
"dependencies": { | |||
"@types/graphql": ">=0.8.6 <=0.11.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.12.x should also export DocumentNode
, how about >=0.8.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the time I opened this PR 0.12 didn't exist, will update.
I don't understand the second question? 0.8.6 was the first version to export it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that by just specifying the dependency as "@types/graphql": ">=0.8.6"
, and omitting the <=x.x.x
the right hand side won't continue to need to be bumped each time a release is cut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you know the next version does not contain a breaking change? It doesn't have to be bumped every time a release is cut, it's an interface so it will work fine if you use a different version in your project that is compatible
@felixfbecker did you sign the agreement? |
Yes I did. I cant tell you if this will get merged anytime soon. Seems like nobody is maintaining this project |
thank you! |
@felixfbecker can you provide an example? |
live in |
Interpreting the question by @4F2E4A2E:
@felixfbecker Could you provide an example of how Thanks a lot! 😃 |
@felixfbecker just got a closer look at your pr => it was about the return value and not about type safe queries. Sorry for that. Anyway, it seams not to be possible right, but i ask anyway, do someone know a way to define graphql queries type safe with typescript? |
@4F2E4A2E there is a TypeScript language service plugin that gives you autocompletion for fields and you can generate typings for the return types of queries. Not aware of other solutions. |
@felixfbecker thanks, do you mean the visual code plugin? Have checked that out already, it's only for vs. I am looking for a ts solution which can be validate via type safty. |
No, I am talking about https://github.com/Quramy/ts-graphql-plugin. This is getting a bit off topic here, I would suggest you move this over to StackOverflow or Gitter if you need more help |
StackOverflow is great thanks, but that link is what i meant by visual code => no that's not it, I am looking for a type safe way to write graphql queries via typescript. Thanks anyway 👍 |
That link is not a Visual Studio Code plugin. It's a TypeScript language service plugin. You define it in tsconfig.json. It will work with any editor that uses the TypeScript language service, e.g. Atom or Sublime. |
This reverts commit 204cd50.
Closes #138
I used the broadest possible version range for
@types/graphql
that exportsDocumentNode
to get the biggest chance of deduping.Also changed the string tag signature to not use
any
, likeString.raw
.