Skip to content

apollo.config.js is overriden by default flags #510

@klujanrosas

Description

@klujanrosas

While trying out the new apollo.config.js file, I couldn't manage to get past the following error:
image

I dived into the source and discovered that the oclif.manifest.json defines a default queries value

{
  "queries":{
    "name": "queries",
    "type": "option",
    "description": "Path to your GraphQL queries, can include search tokens like **",
    "default":"**/*.graphql"
  }
}

That wouldn't be a problem until I spotted a suspicious check being performed here:
https://github.com/apollographql/apollo-cli/blob/8d8221da4b6aa775a4046b0661647eee4d388d60/packages/apollo-cli/src/load-config.ts#L62-L70

Which basically is overriding the values specified in apollo.config.js, since flags.queries always holds a value.

I'll get my hands on this and submit a PR if you agree!
I couldn't help myself and went ahead and submitted a PR

Thank you for making this awesome tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions