Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

File change notifications delivered via watchman do not work if there are projects specified in .graphqlconfig #223

Closed
mgadda opened this issue Apr 10, 2018 · 1 comment
Assignees
Labels

Comments

@mgadda
Copy link
Collaborator

mgadda commented Apr 10, 2018

This is a bug that shook out the refactoring to make watchman optional #218. If watchman is installed on the user's system, we need to subscribe the loaded project or projects from .graphqlconfig to file change events. However, it looks like in the case where the .graphqlconfig didn't define any projects, that is, it just contains top-level data about the project, this line blows up because config.getProjects returns undefined.

The simple fix should be:

let projectConfigs: GraphQLProjectConfig[] =
        Object.values(config.getProjects() || {}) || [];
@mgadda mgadda added the bug label Apr 10, 2018
@mgadda mgadda self-assigned this Apr 10, 2018
@mgadda mgadda changed the title File change notifications delivered via watchman does not work if there are projects specified in .graphqlconfig File change notifications delivered via watchman do not work if there are projects specified in .graphqlconfig Apr 11, 2018
mgadda pushed a commit to mgadda/graphql-language-service that referenced this issue Apr 11, 2018
@mgadda mgadda reopened this Apr 13, 2018
@mgadda
Copy link
Collaborator Author

mgadda commented Apr 13, 2018

It looks like my patch above is compiled out of existence by flow.

src/MessageProcessor.js:

Object.values(config.getProject() || {}) || []

in dist/MessageProcessor.js, becomes:

Object.values(config.getProject()) || []

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant