question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto complete and validation for multiple projects.

See original GitHub issue

I want to use multiple GraphQL endpoint on single project, but this extension seems load only one (first) project even if multiple project exists on graphql.config.yml.

Here’s example, only 3 files on directory. Open the directory with VSCode that installed this extension.

graphql.config.yml

projects:
  rickandmortyapi:
    schema: https://rickandmortyapi.com/graphql
  spaceX:
    schema: https://api.spacex.land/graphql/

spacex.graphql

query getUsers {
  users {
    id
    name
  }
}

query getDragons {
  dragons {
    id
    name
  }
}

rickandmorty.graphql

query getCaracters {
  characters {
    results {
      name
    }
  }
}

query getLocations {
  locations {
    results {
      name
    }
  }
}

In above case, rickandmorty.graphql is perfectly validated and auto completed but spacex.graphql throws validation error.

Cannot query field “users” on type “Query”

Yes, I know it is difficult to find proper project for each .graphql file automatically. So is there any way to assign specific project to each .graphql file? Can I find some reference about this anywhere?

If there’s no way so far, I want feature like this.

spacex.graphql

#[[spaceX]]
query getUsers {
  users {
    id
    name
  }
}

query getDragons {
  dragons {
    id
    name
  }
}

rickandmorty.graphql

#[[rickandmortyapi]]
query getCaracters {
  characters {
    results {
      name
    }
  }
}

query getLocations {
  locations {
    results {
      name
    }
  }
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
acaocommented, Nov 1, 2021

I don’t think this will solve the multi-project config issue. This known issue is on our roadmap, it will take us a while since we‘re all volunteers

0reactions
acaocommented, Jul 26, 2022

@Chnapy so users would need to annotate every single template literal for it to work? or change the name of every query. I don’t think this approach is sustainable, though I’m glad it worked for your team. We cannot implement strict conventions like these, as this extension is used by people using all kinds of projects, frameworks and conventions. We’re a reference implementation, besides, so it’s not up to us to set any conventions outside of the spec.

We will remain with using graphql config to define project configurations, we just need to fix the multi-project cache and make it work with workspaces. Hopefully someone has time to pick it up, work has been busy so it may be some more months until I can get to this, but I think about it all the time don’t worry haha

If folks want a multi-project LSP server and vscode extension that works now, and you’re using relay, try the relay extension! it’s really incredibly and it works with multi projects (called environments in relay) and multi-workspaces.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto complete and validation for multiple projects. · Issue #2293
I want to use multiple GraphQL endpoint on single project, but this extension seems load only one (first) project even if multiple project...
Read more >
Speed up data entry and validation with AutoComplete for ...
AutoComplete for dropdown list helps speed-up discovery of the right Data Validation values at first attempt, and in turn, reduces time spent ...
Read more >
Address Autocomplete | What it is and how to use it
Address Autocomplete is an address form feature that predicts and suggests street addresses while users type. Autocomplete Address APIs make data submission ...
Read more >
Autocomplete Workaround for Validation Dropdowns
On a client's project I worked on today we really needed autocomplete capability. The dropdown list was 80 rows long and the values...
Read more >
Autocomplete Questions & Supplemental Data - Qualtrics
Go to the survey or imported data project you'd like to use as a data source. · Go to the Data & Analysis...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found