Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP Server config doesn't work with customFetch #2018

Open
Tracked by #2062
madeleineostoja opened this issue Oct 3, 2021 · 5 comments
Open
Tracked by #2062

LSP Server config doesn't work with customFetch #2018

madeleineostoja opened this issue Oct 3, 2021 · 5 comments
Labels
bug confirmed bug lsp-server graphql-language-service-server

Comments

@madeleineostoja
Copy link

Actual Behavior

When using a remote schema (with a custom fetch in my case) autocomplete fails silently. When I generate a schema from introspection from that same schema definition with graphql-cli and use that, autocomplete works again.

My config (for Prismic

schema:
  https://heybokeh.cdn.prismic.io/graphql:
    customFetch: 'codegen-prismic-fetch'
documents: './src/**/*.{graphql,ts,tsx}'
...

Expected Behavior

This extension should work with remote schemas defined in graphql config

Steps to Reproduce the Problem Or Description

  1. Specify remote schema with custom fetch in graphql config
  2. Try write queries, see that autcomplete doesn't work

Specifications

  • GraphQL for VSCode Extension Version: v0.3.18
  • VSCode Version: 1.60.2
  • OS Name: macOS
  • OS Version: 11.4
@acao acao transferred this issue from graphql/vscode-graphql Nov 11, 2021
@acao acao added lsp-server graphql-language-service-server bug known bugs labels Nov 11, 2021
@acao
Copy link
Member

acao commented Nov 29, 2021

does this issue appear to be resolved in the latest release?

@madeleineostoja
Copy link
Author

I just tested it again and yep it's still an issue

@acao
Copy link
Member

acao commented Feb 22, 2022

The issue is with customFetch. Is that from graphql mesh config or something? We need to look up where these customFetch configs come from

@acao acao changed the title Autocomplete doesn't work with remote schema Autocomplete doesn't work with customFetch Feb 22, 2022
@madeleineostoja
Copy link
Author

madeleineostoja commented Feb 23, 2022

Ah okay, thought it was part of the standard. It's used by a few tools, namely graphql-codegen and graphql-cli (I assume via graphql mesh). A custom fetch is needed for Prismic (in my case) because you need to get a ref from its API to set in a header for the actual request.

For now a perfectly acceptable workaround is generating a JSON schema through introspection and pointing GraphQL config to that instead.

@acao
Copy link
Member

acao commented Feb 23, 2022

Sorry about that, sounds less than ideal :/

I don't see any reference to customFetch in graphql-config, so it must have to do with UrlLoader or something else in graphql-tools? Will have to add this to the roadmap

@acao acao changed the title Autocomplete doesn't work with customFetch LSP Server config doesn't work with customFetch Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed bug lsp-server graphql-language-service-server
Projects
None yet
Development

No branches or pull requests

2 participants