Skip to content
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

Templates should be written in TypeScript #123

Open
1 of 2 tasks
mekwall opened this issue Nov 6, 2017 · 4 comments
Open
1 of 2 tasks

Templates should be written in TypeScript #123

mekwall opened this issue Nov 6, 2017 · 4 comments

Comments

@mekwall
Copy link

mekwall commented Nov 6, 2017

Issue type:

I am submitting:

  • an issue
  • a feature request

What feature would you like to see added? Please be descriptive.

I would like to see all examples to be written in TypeScript to encourage people to adopt it. It makes a lot of sense to write resolvers in TS since it would help make them more robust and less bug prone.

Would you be able to submit a PR for this yourself?

Yes, I might be able to contribute to some of them.

@kbrandwijk
Copy link
Contributor

I would like to see multiple language branches, so Graphcool templates are also easily accessible to vanilla JS developers. http://githut.info/ Typescript is still in place 34 on Github, versus Javascript in place 1...

@mekwall
Copy link
Author

mekwall commented Nov 8, 2017

Sure, I wouldn't mind if they existed in both JavaScript and TypeScript. If you write them in TS you can easily convert them to JS. It's much more of a hassle to do the opposite for obvious reasons.

So, should we just have separate examples for TypeScript or should they reside in the same examples (probably not supported atm)?

@iamclaytonray
Copy link
Contributor

^ Maybe a win-win could be setting up a tsconfig.json and transpiling (in a pre-commit hook) the TS to JS. There would still have to be a bit of refactoring but it would, for the most part, be the same. I agree that it's a LOT easier for developers to transpile TS to JS instead of the other way around.

@maxdarque
Copy link

As someone who no TypeScript when I started, the templates in TS were simple and easy to follow. I easily striped out the TS when I reused the code for other functions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants