Skip to content

Conversation

@mernxl
Copy link
Collaborator

@mernxl mernxl commented Sep 18, 2018

As the DiscriminatorTypeComposer extends TypeComposer, we needed to configure type updated type definitions by updating the graphql-compose package.

Note: Issues may arise for TypeScript Users if they update one without matching with the other.
A TypeScript User with this a package that has this changes, will need to update graphql-compose to atleast v5.2.0

  • feat(TypeScript): add helpers for resolver args, get by ${ResolverName}Args
PostTC.getResolver('findMany').wrapResolve<any, FindManyArgs<IPost>>(
  next => rp => {
    if (rp.source && rp.args) {
      rp.args.limit = 50;
      // fix this to display only Post fields.
      // Avoid Document fields
      rp.args.filter.title = 'New Title';
      // rp.args.filter.title = 5;
      // rp.args.limit = 'limit';
    }
  },
);
  • feat(TypeScript): add TArgs and TArgsMap to DiscriminatorTypeComposer

  • chore: update graphql-compose to v5.2.0 as it contains TArgs, TArgsMap changes

  • feat(TypeScript): add typings for DiscriminatorTypeComposer

  • fix(TypeScript): adjust composeMongoose types to support new TypeComposer typings

  • chore: update graphql-compose to v5.1.1
    this is to get all the latest changes that were made with TypeComposer

  • chore: add tslint prettier rules plugins, apply styles to all .ts files

  • add tslint-config-prettier and tslint-plugin-prettier packages

…iles

* add `tslint-config-prettier` and `tslint-plugin-prettier` packages
this is to get all the latest changes that were made with TypeComposer
fix(TypeScript): adjust composeMongoose types to support new TypeComposer typings
@nodkz
Copy link
Member

nodkz commented Sep 18, 2018

Amazing! 💪
Thinking about migration on typescript 🤓🤪

@mernxl
Copy link
Collaborator Author

mernxl commented Sep 21, 2018

Hahaha, typescript is great, like a Swiss army knife for typings.

@mernxl mernxl changed the title feat(TypeScript): add typings for DiscriminatorTypeComposer WIP: feat(TypeScript): add typings for DiscriminatorTypeComposer Sep 21, 2018
@mernxl mernxl changed the title WIP: feat(TypeScript): add typings for DiscriminatorTypeComposer feat(TypeScript): add typings for DiscriminatorTypeComposer Sep 22, 2018
@mernxl
Copy link
Collaborator Author

mernxl commented Sep 22, 2018

@nodkz review for merging. Sorry been so unstable lately.

@nodkz
Copy link
Member

nodkz commented Sep 22, 2018

Typescript and Flowtype a both amazing instruments!

While graphql-js will be on flowtype we should use it. But great that we a support typescript and keep it in sync for every version.

@mernxl mernxl merged commit e18cf8f into graphql-compose:master Sep 22, 2018
@nodkz
Copy link
Member

nodkz commented Sep 22, 2018

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mernxl mernxl changed the title feat(TypeScript): add typings for DiscriminatorTypeComposer feat(TypeScript): add typings for DiscriminatorTypeComposer, add helpers for resolver args, get by ${ResolverName}Args Sep 22, 2018
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.

2 participants