Intended outcome:
When running codegen when the project is configured to use a schema from Apollo Engine, yet when the ENGINE_API_KEY environment variable is not defined, loading the schema should fail with a descriptive error, suggesting perhaps that the user is missing an Apollo Engine API key, or the user lacks permissions to obtain the schema, or the Apollo project is misconfigured.
Actual outcome:
When running codegen when the project is configured to use a schema from Apollo Engine, yet when the ENGINE_API_KEY environment variable is not defined, loading the schema fails with a cryptic error, e.g.
Error: Error initializing Apollo GraphQL project "myproject": Error: Error in "Loading schema for myproject": TypeError: Cannot read property 'startsWith' of undefined
How to reproduce the issue:
Create a dummy project configured to have schema pulled from Apollo Engine, and then run codegen on the project with the API key missing.
Intended outcome:
When running
codegenwhen the project is configured to use a schema from Apollo Engine, yet when theENGINE_API_KEYenvironment variable is not defined, loading the schema should fail with a descriptive error, suggesting perhaps that the user is missing an Apollo Engine API key, or the user lacks permissions to obtain the schema, or the Apollo project is misconfigured.Actual outcome:
When running
codegenwhen the project is configured to use a schema from Apollo Engine, yet when theENGINE_API_KEYenvironment variable is not defined, loading the schema fails with a cryptic error, e.g.How to reproduce the issue:
Create a dummy project configured to have schema pulled from Apollo Engine, and then run
codegenon the project with the API key missing.