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

Doesn't work with schema path outside project root #33

Closed
peterholak opened this issue Jun 28, 2017 · 9 comments
Closed

Doesn't work with schema path outside project root #33

peterholak opened this issue Jun 28, 2017 · 9 comments

Comments

@peterholak
Copy link

schema: {
    files: '../graphql/*.graphql'
}

doesn't work, while

schema: {
    files: 'graphql/*.graphql'
}

works just fine.

Using it on Windows 10, not sure how to get any useful error message (I just see an error icon in VSCode and the plugin features don't work).

@kumarharsh
Copy link
Owner

This plugin was designed with the expectation that the graphql files would be included with the project and checked into source control - you'll also need to put the .gqlconfig file in the root of your project. May I know about your use case?

@peterholak
Copy link
Author

I have a project where both the client and the server (multiple different servers in fact) are in the same git repository, and share the same graphql schema. So the directory structure goes something like

|- client
    |- package.json
    |- webpack.config.js
    |- ...
|- server1
|- server2
|- graphql
    |- schema.graphql
|- README.md and other stuff

In VSCode, I only open the client directory, because it's more convenient (no irrelevant clutter when doing project-wide search, correct default working directory for scripts, etc.).

@kumarharsh
Copy link
Owner

Got it.

@kumarharsh kumarharsh self-assigned this Aug 22, 2017
@kumarharsh
Copy link
Owner

kumarharsh commented Sep 12, 2017

So, I looked into the related gql project internals, and it uses minimatch for matching your paths. Minimatch doesn't support specifying .. in the path. I think we can do a fix on our end to handle relative paths with .. in some special way.

Update: also, it seems like watchman too doesn't like '..' in watch-path, which causes it to get stuck after establishing watch on the path with dots. Investigating...

@peterholak
Copy link
Author

peterholak commented Sep 12, 2017

I wonder if it's even worth fixing with the dependencies being how they are... Maybe waiting for fixes in those would be cleaner.

@kumarharsh
Copy link
Owner

I've figured out how to fix it on my side, not sure if watchman supports it though... The docs are a little lacking - I'll dig there some more. Just a quick question @peterholak, your client and server1, server2... folders are all nested within the same root folder. Is the root folder the git root too? Does the .git folder lie in the root folder, or in each subfolder?

@peterholak
Copy link
Author

Just one .git in the root folder.

@kumarharsh
Copy link
Owner

I think this feature might be possible after this is resolved.

kumarharsh pushed a commit that referenced this issue May 2, 2018
- adds support for multi-root workspaces. Closes #33
- interfaces with @playlyfe/gql v3. Closes #83
- can auto-download gql library if not found. Addresses #16

other changes:
- update language server to v4.
- add prettier and format extension code.

BREAKING_CHANGES: the extension options have changed.
You'll need to go into your settings page, and configure these options:
* graphqlForVSCode.autoDownloadGQL: auto download @playlyfe/gql if not
* graphqlForVSCode.gqlPath: An absolute path to @playlyfe/gql module, if
not auto-downloaded. If the library is located at the path
`${workspaceRoot}/src/ui/node_modules/@playlyfe/gql`, you need to set
the gqlPath as `${workspaceRoot}/src/ui`.
* graphqlForVSCode.configDir: An absolute path to directory containing
the `.gqlConfig` file. You can use `${workspaceRoot}` to specify the
root.
* graphqlForVSCode.watchman: use fb-watchman to watch files _if available_
kumarharsh pushed a commit that referenced this issue May 4, 2018
- adds support for multi-root workspaces. Closes #33
- interfaces with @playlyfe/gql v3. Closes #83
- can auto-download gql library if not found. Addresses #16

other changes:
- update language server to v4.
- add prettier and format extension code.

BREAKING_CHANGES: the extension options have changed.
You'll need to go into your settings page, and configure these options:
* graphqlForVSCode.autoDownloadGQL: auto download @playlyfe/gql if not
* graphqlForVSCode.gqlPath: An absolute path to @playlyfe/gql module, if
not auto-downloaded. If the library is located at the path
`${workspaceRoot}/src/ui/node_modules/@playlyfe/gql`, you need to set
the gqlPath as `${workspaceRoot}/src/ui`.
* graphqlForVSCode.configDir: An absolute path to directory containing
the `.gqlConfig` file. You can use `${workspaceRoot}` to specify the
root.
* graphqlForVSCode.watchman: use fb-watchman to watch files _if available_
@kumarharsh
Copy link
Owner

🎉 This issue has been resolved in version 1.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants