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

typescript: generate types for resolvers #386

Merged
merged 5 commits into from
Jun 24, 2018
Merged

typescript: generate types for resolvers #386

merged 5 commits into from
Jun 24, 2018

Conversation

kamilkisiela
Copy link
Collaborator

@kamilkisiela kamilkisiela commented Jun 19, 2018

Closes #319

I changed a bit how expect().toBeSimilarStringTo works, it was comparing a template from start to end now it checks if a template contains a part we're looking for.

  • some tests are breaking other tests
  • add more tests
  • issue with graphql-tools (show it to me! / show an example)
  • maybe a flag that enables / disables generating types for resolvers?
  • maybe a different template that does that

Example: https://github.com/kamilkisiela/gql-gen-with-resolvers

@dotansimha

@dotansimha
Copy link
Owner

maybe a flag that enables / disables generating types for resolvers?

You can use schema-specific config, for example: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/templates/typescript/src/enum.handlebars#L2

maybe a different template that does that

I think it's okay that it's part of this template.

issue with graphql-tools

It's an issue with TypeScript: microsoft/TypeScript#15300 , I think we can safely use as any for now, because there is not other option :/

@kamilkisiela kamilkisiela changed the title [WIP] typescript: generate types for resolvers typescript: generate types for resolvers Jun 21, 2018
@dotansimha
Copy link
Owner

Awesome! Thanks @kamilkisiela !

@dotansimha dotansimha merged commit 10e255e into dotansimha:master Jun 24, 2018
@fabien0102
Copy link

I really need to try this!!! Thanks @kamilkisiela 🎉

@kamilkisiela kamilkisiela deleted the feature/types-of-resolvers branch June 24, 2018 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate resolver types?
3 participants