graphql-schema-registry icon indicating copy to clipboard operation
graphql-schema-registry copied to clipboard

Add TypeScript definitions

Open marcpascualsanchez opened this issue 2 years ago • 2 comments

Hello @tot-ra :wave: As mentioned in another issue we are planning to add new features. Exploring the code we realised that some types are missing. We plan to gradually add typing while developing new features.

We have notticed the GraphQL schema is manually specified. We have used a GraphQL + TypeScript library (typegraphql) for other projects that works well. Do you think it's OK to refactor the project using it? This change may affect a significant part of the project.

Thank you so much! :smile:

marcpascualsanchez avatar May 04 '22 15:05 marcpascualsanchez

hey. I didn't use it myself & looking at typescript decorators feature it reminds me of doctrine or java.

I personally dislike this style of meta-programming because

  • it takes away control from the regular iterative style & adds more declarative style instead
  • it adds much noise @annotations to class & method definitions, that I'm loosing focus of the actual logic

On the other hand, I was sceptical of typescript too initially 🤷🏻‍♂️ . I'd suggest to add some minor PR into this repo to see how it looks like & how much issues does it solve. WDYT?

tot-ra avatar May 04 '22 15:05 tot-ra

I understand the cons of using decorators but I still think the pros of faster development and GraphQL schemas from source code are good enough to consider it. Still, it's not a big deal.

Talking about typescript, we can add it to a part of the project and show it in a PR as you said :+1:

marcpascualsanchez avatar May 05 '22 10:05 marcpascualsanchez