apollographql / apollographql/apollo-tooling

apollo client:download-schema reports error

Open
#1,934 4 comments 6 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

My apollo.config.js is
```
module.exports = {
client: {
service: {
name: 'Public API',
url: 'DoesNotMatter',
skipSSLValidation: true
}
}
}
```
and when I run `apollo client:download-schema schema.json` it returns:
```
CLIError: Error in "Loading queries for Public API": Error: ️️There are multiple definitions for the `apiFields` operation. Please rename or remove all operations with the d
uplicated name before continuing.
at Object.error (C:\Data\Work\Zasilkovna\repo\ui\node_modules\@oclif\errors\lib\index.js:22:17)
at SchemaDownload.error (C:\Data\Work\Zasilkovna\repo\ui\node_modules\apollo\node_modules\@oclif\command\lib\command.js:57:23)
at OclifLoadingHandler.showError (C:\Data\Work\Zasilkovna\repo\ui\node_modules\apollo\lib\OclifLoadingHandler.js:28:22)
at OclifLoadingHandler.handle (C:\Data\Work\Zasilkovna\repo\ui\node_modules\apollo\lib\OclifLoadingHandler.js:13:18) {
oclif: { exit: 2 },
code: undefined
}
```

Even when URL is not defined in config, it throws same error. But without this file it is not working. Does it looks to another configuration as well? Or where is problem?

Contributor guide

Open the contributing guide

Research direction

Start with apollo.config.js and the `apollo client:download-schema schema.json` command, then inspect the reported `SchemaDownload` and `OclifLoadingHandler` stack entries. Reproduce the duplicate `apiFields` error with and without the configuration file; done means identifying which configuration or query source causes the error and documenting the confirmed fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.