apollographql / apollographql/apollo-tooling
Error thrown when using `client:download-schema` with a Consumer APOLLO_KEY
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
**Intended outcome:** No error thrown or some way to turn off fetching stats (as they aren't actually needed by the Consumers).
**Actual outcome:**
```
[GraphQL error]: Exception while fetching data (/service/stats) : NOT_ALLOWED_BY_USER_ROLE
Error: Exception while fetching data (/service/stats) : NOT_ALLOWED_BY_USER_ROLE
at ApolloEngineClient.loadSchemaTagsAndFieldStats (node_modules/apollo-language-server/lib/engine/index.js:181:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async node_modules/apollo-language-server/lib/project/client.js:200:52
at async OclifLoadingHandler.handle (node_modules/apollo/lib/OclifLoadingHandler.js:9:25)
at async GraphQLClientProject.loadEngineData (node_modules/apollo-language-server/lib/project/client.js:198:9)
```
**How to reproduce the issue:**
Run `npx apollo client:download-schema` with a Consumer `APOLLO_KEY`
**Versions**
2.32.5
Contributor guide
Research direction
Start with ApolloEngineClient.loadSchemaTagsAndFieldStats in node_modules/apollo-language-server/lib/engine/index.js and the call from node_modules/apollo-language-server/lib/project/client.js when running npx apollo client:download-schema. Reproduce with a Consumer APOLLO_KEY, then determine how the command can avoid or disable the /service/stats request; done when schema download no longer fails for that key.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100