Skip to content

Reload schema command doesn't reflect added fields #1446

@venkatd

Description

@venkatd

I have a apollo.config.js like this:

module.exports = {
  client: {
    includes: ['src/**/*.js', 'src/*.js'],
    service: {
      url: 'http://localhost:4000'
    }
  },
};

If I add a field tohttp://localhost:4000 and run the Apollo: Reload schema command, this field is not picked up unless I completely restart VSCode.

Hoping to get this working for a demo on Apollo I'm giving next week :). Will make the workflow a lot smoother if I can modify the backend and then show the results immediately.

A minimal reproduction is below:
reload-test.zip

Steps to reproduce:

  • npm install
  • npm server.js
  • Open the folder in vscode and in src/client.js you'll be able to see that autocomplete is working properly
  • stop the server, uncomment the year property, and restart the server
  • In vscode, run the Apollo: Reload schema command
  • Go back to src/client.js and try to type something. You'll see that the year field is not being picked up
  • Restart vscode and go back to src/client.js you'll see the year field is now available

However, if I do the same but I comment out a field such as author and call the reload schema command, this gets picked up properly without needing a restart with a message like Cannot query field "author" on type "Book".

Any guidance on where to begin investigating would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions