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

Feature: Reload on save with legacy config filenames #2160

Closed
johhansantana opened this issue Jan 28, 2021 · 6 comments · Fixed by #2901
Closed

Feature: Reload on save with legacy config filenames #2160

johhansantana opened this issue Jan 28, 2021 · 6 comments · Fixed by #2901
Labels
bug lsp-server graphql-language-service-server

Comments

@johhansantana
Copy link

As requested here:
graphql/vscode-graphql#104 (comment)

Actual Behavior

Doesn't update generated schema on changes.

Expected Behavior

Update generated schema on changes or have a manual option to tell it to update the generated file.

Steps to Reproduce the Problem Or Description

When using a separate local server, I add a .graphqlconfig file to the root of my project with this:

{
  "name": "GraphQL Schema",
  "schemaPath": "schema.graphql",
  "extensions": {
    "endpoints": {
      "Default GraphQL Endpoint": {
        "url": "http://localhost:4000/graphql",
        "headers": {
          "user-agent": "JS GraphQL"
        },
        "introspect": true
      }
    }
  }
}

The autogenerated file gets fetched once but when I do changes I have no way on telling it to refetch it and it doesn't update on its own even after restarting vscode.

Specifications

  • GraphQL for VSCode Extension Version: 0.3.13
  • VSCode Version: 1.52.1
  • OS Name: MacOS
  • OS Version: Big Sur 11.1
@yairopro
Copy link

yairopro commented Dec 6, 2021

image

@acao
Copy link
Member

acao commented Dec 6, 2021

It should refresh automatically on config file save events. You are using a legacy graphql config filename that the server isnt able to detect to reload

@acao acao changed the title Feature: A way to manually refetch schema Feature: Reload on save with legacy config filenames Dec 6, 2021
@acao acao transferred this issue from graphql/vscode-graphql Feb 8, 2022
@acao
Copy link
Member

acao commented Feb 8, 2022

Ok I understand much better after re-reading! This is something I was wondering about as well. The schema is not refetching? It used to, but I think I know what has changed since

@acao acao added enhancement lsp-server graphql-language-service-server labels Feb 8, 2022
@moshest
Copy link

moshest commented May 8, 2022

A quick workaround is to assign Ctrl+S for it:

image

You can also limit it only for graphql files: ${fileExtname} == '.gql' || ${fileExtname} == '.graphql'

@valerii15298
Copy link

@moshest can you please point out where should I put ${fileExtname} == '.gql' || ${fileExtname} == '.graphql' in order for vs code to execute @command:vscode-graphql.restart on save or when .gql files change?

@moshest
Copy link

moshest commented Apr 30, 2023

@valerii15298 sure. You should put in under the when column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp-server graphql-language-service-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants