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

Error with duplicate operation names #1466

Merged
merged 4 commits into from
Aug 15, 2019

Conversation

JakeDawkins
Copy link
Contributor

@JakeDawkins JakeDawkins commented Aug 8, 2019

Currently, the apollo-language-server requires operation names in a client project to be unique in order to properly generate types, but this isn't enforced by an error. This PR adds an error so the user is aware of a name collision.

When generating a type using codegen, if there are duplicate type names, only one of the operations will get types generated. this error will enforce the already designed intention of the CLI.

The following screenshot shows the error as well as showing that the error doesn't interfere with --watch mode.

Screen Shot 2019-08-08 at 7 47 37 PM

resolves #1427

TODO:

  • Update CHANGELOG.md* with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.

@JakeDawkins JakeDawkins changed the title Add warning for duplicate operation names Error with duplicate operation names Aug 8, 2019
CHANGELOG.md Outdated Show resolved Hide resolved
@JakeDawkins JakeDawkins force-pushed the jake/warn-duplicate-operations branch from f3aa26a to 68b2a5f Compare August 15, 2019 15:58
@JakeDawkins JakeDawkins merged commit 795cffc into master Aug 15, 2019
@JakeDawkins JakeDawkins deleted the jake/warn-duplicate-operations branch August 15, 2019 20:10
essaji pushed a commit to essaji/apollo-tooling that referenced this pull request Aug 25, 2019
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.

codegen: output warning if query type generation is suppressed because of naming conflict
2 participants