-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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-apollo-angular ignores importOperationTypesFrom #4719
Comments
Sorry to pollute this issue, I can submit another, but I'm having another problem with this approach as well - when documentMode is set to external for the angular.ts output, the document names do not match in angular.ts. angular.ts example service when generated in the same file as operations
when imported from a separate file using documentMode external
expected is
|
… related to #4719 (#4765) * modify apollo angular visitor to allow external opration definitions * handle document * fix document * resolve unit test failures * add unit test * reset version * add changeset * add a warning for importOperationTypesFrom, update apollo-angular documentation * more warnings and tests to help get configuration correct * more eslint ignores * update documentation for external documentMode * more readme updates * more readme updates
* Bump eslint-config-standard from 14.1.1 to 16.0.1 Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.1 to 16.0.1. - [Release notes](https://github.com/standard/eslint-config-standard/releases) - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md) - [Commits](standard/eslint-config-standard@v14.1.1...v16.0.1) Signed-off-by: dependabot[bot] <support@github.com> * Improve typescript vue apollo plugin (#5007) * feat: support type imports Closes #5006 * fix: do not use undefined for variables generic and parameter Not using undefined for variables generic fixes the following issue: Type 'undefined' does not satisfy the constraint 'Record<string, any>' Not using undefined for variables parameter fixes the following issue: Argument of type 'undefined' is not assignable to parameter of type 'VariablesParameter<Exact<{ [key: string]: never; }>>' * feat: improve jsdoc formatting * Remove newlines before and after the first argument in the example code. * Add @param variables where applicable. * chore: add changeset * chore: update dev-test examples * fix(cli): resolve modules provided through the -r flags relative to the cwd (#4983) * fix(cli): require -r flags relative to the cwd * chore: disable eslint for import * fix(cli): resolve from folders correctly (#5032) * fix(cli): resolve from folders correctly * chore: changesets * modify apollo angular visitor to allow external operation definitions related to #4719 (#4765) * modify apollo angular visitor to allow external opration definitions * handle document * fix document * resolve unit test failures * add unit test * reset version * add changeset * add a warning for importOperationTypesFrom, update apollo-angular documentation * more warnings and tests to help get configuration correct * more eslint ignores * update documentation for external documentMode * more readme updates * more readme updates * fix(vue-apollo): regression, respect omitOperationSuffix even with dedupeOperationSuffix enabled (#5015) * fix(vue-apollo): regression, respect omitOperationSuffix even with dedupeOperationSuffix enabled * updated changeset * fix changeset Co-authored-by: Dotan Simha <dotansimha@gmail.com> * Bump graphql from 15.3.0 to 15.4.0 (#5008) * Bump graphql from 15.3.0 to 15.4.0 Bumps [graphql](https://github.com/graphql/graphql-js) from 15.3.0 to 15.4.0. - [Release notes](https://github.com/graphql/graphql-js/releases) - [Commits](graphql/graphql-js@v15.3.0...v15.4.0) Signed-off-by: dependabot[bot] <support@github.com> * update all snapshot fix for patches Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dotan Simha <dotansimha@gmail.com> * Bump eslint-config-standard from 14.1.1 to 16.0.1 Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 14.1.1 to 16.0.1. - [Release notes](https://github.com/standard/eslint-config-standard/releases) - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md) - [Commits](standard/eslint-config-standard@v14.1.1...v16.0.1) Signed-off-by: dependabot[bot] <support@github.com> * fixes for lint issues Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pascal Sthamer <sthamer.pascal@gmail.com> Co-authored-by: Kristoffer K <merceyz@users.noreply.github.com> Co-authored-by: Jeffrey Barrus <1044815+jbarrus@users.noreply.github.com> Co-authored-by: JoeSchr <JoeSchr@users.noreply.github.com> Co-authored-by: Dotan Simha <dotansimha@gmail.com>
Fixed in |
Describe the bug
https://graphql-code-generator.com/docs/plugins/typescript-apollo-angular lists
importOperationTypesFrom
as a valid config but it is ignoredTo Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/hungry-saha-4t2pq?file=/angular.ts
Additional Context
I'm trying to generate types and operations in one lib and angular services in another to segregate the angular dependency (i.e. I want to be able to import operations from non-angular code and not pull in angular as a dependency). The examples for this are somewhat limited, so I may be doing this wrong, but I think I have the right config but the "importOperationTypesFrom" doesn't seem to be implemented in the typescript-apollo-angular plugin.
https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/apollo-angular/src/visitor.ts#L263
As a note, this does appear to be implemented in the typescript-apollo-react plugin:
https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/react-apollo/src/visitor.ts#L442
The text was updated successfully, but these errors were encountered: