How to use the apollo-language-server.loadConfig function in apollo-language-server

To help you get started, we’ve selected a few apollo-language-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apollographql / apollo-tooling / packages / apollo / src / Command.ts View on Github external
protected async createConfig(flags: Flags) {
    const service = flags.key ? getServiceFromKey(flags.key) : undefined;
    const config = await loadConfig({
      configPath: flags.config && parse(resolve(flags.config)).dir,
      configFileName: flags.config,
      name: service,
      type: this.type
    });

    if (!config) {
      this.error("A config failed to load, so the command couldn't be run");
      this.exit(1);
      return;
    }

    config.tag = flags.tag || config.tag || "current";
    //  flag overrides
    config.setDefaults({
      engine: {
github apollographql / apollo-tooling / packages / apollo / src / NewCommand.tsx View on Github external
async loadConfigFromFlags(flags: Record, service?: string) {
    const config = await loadConfig({
      configPath: flags.config && parse(resolve(flags.config)).dir,
      configFileName: flags.config,
      name: service,
      type: this.type // how do we set this for client projects?
    });

    if (!config)
      throw new Error(
        "A config failed to load, so the command couldn't be run"
      );

    config.tag = flags.tag || config.tag || "current";
    // flag overrides
    config.setDefaults({
      engine: {
        apiKey: flags.key,