-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support absolute paths and NODE_PATH #37
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 29 31 +2
Branches 3 4 +1
=====================================
+ Hits 29 31 +2
Continue to review full report at Codecov.
|
Ping :D @evenchange4 |
ping @evenchange4 this would be great to have |
const queryPath = path.join(filename, '..', value); | ||
const queryPath = value.startsWith('./') | ||
? path.join(filename, '..', value) | ||
: resolvePathFromCwd(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition does not cover the case when relative path starts with ../
. I would rather use path.isAbsolute
function to check whether path is absolute.
const queryPath = path.isAbsolute(value)
? resolvePathFromCwd(value)
: path.join(filename, '..', value);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further testing, I found out that isAbsolute
is not what we need here because it returns false
for foo/bar
. value.startsWith('./') || value.startsWith('../')
suits better.
ping @evenchange4 would love to see that |
@evenchange4 really need this feature to be merged, could you help please? |
This covers the use-case of having a mono-repo setup with graphql files in another package of your mono-repo. These packages will be symlinked in `node_modules`. This PR uses the work from #37 as a basis
Thanks! Released |
Resolves #36.
About NODE_PATH, we use to have this setting with projects created via create-react-app.
cc @evenchange4