graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
555 stars 71 forks source link

Adding multiple endpoints to .graphqlconfig.yml breaks autocomplete and goto definition #101

Closed FabHof closed 4 years ago

FabHof commented 5 years ago

Actual Behavior

When adding multiple endpoints to the .graphqlconfig.yml, this extension will not work

working .graphqlconfig.yml

projects:
  ember-adam-oom:
    schemaPath: "app/schema.graphql
    includes: ["**/*.graphql"]
    excludes: ["node_modules"]
    extensions:
      endpoints:
        default: http://localhost:3001/graphql

not working .graphqlconfig.yml

projects:
  ember-adam-oom:
    schemaPath: "app/schema.graphql
    includes: ["**/*.graphql"]
    excludes: ["node_modules"]
    extensions:
      endpoints:
        default: http://localhost:3001/graphql
        develop: https://some-dev-endpont/graphql

Expected Behavior

autocomplete and goto definition should work independent of endpoints.

Specifications

acao commented 4 years ago

@FabHof sorry for this issue, I've confirmed that this is working in the latest release, although you'll have to manually specify

extensions:
  endpoints:
    default:
      url: "http://localhost:3001/graphql"
    develop:
      url: "https://some-dev-endpont/graphql"

in graphql-config@3, the endpoints extension seems to be simplified as such, though i've considered just @ts-ignore'ing the new ts definitions to support the simpler config pattern used by many.

you can now use commonjs and process.env if you want, in case that's helpful

acao commented 4 years ago

if it's working for you now, feel free to close it! the selection for endpoint name should still work, as well