Skip to content

Cryptic error message when failing to load schema from Apollo Engine can be improved #1513

@jhanschoo

Description

@jhanschoo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions