-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
.graphql-let.yml cacheDir relative vs absolute #605
Comments
Adding related context here if you use the jestTransformer, it's very difficult to get it setup alongside a moved config.
Instead, the transformer should generate the ultimate transform location by using the location of the Concretely:
when running jest, it will try to replace the file with the cached file at |
Partially addresses piglovesyou#605 Sets a new cwd context in cases where the config file does not reside in the jest root directory. This is necessary because the config file can then give the cache location, but it will be relative to its own location (not that of the jest config)
Additionally, wanted to add that this same path mismatch issue is encountered looking for schema too. The paths there have the same issue of being generated relative to the "run" directory. So if you have a root generator, but another folder like /app that runs webpack, it becomes impossible to correctly specify paths in the config file. |
Partially addresses piglovesyou#605 Sets a new cwd context in cases where the config file does not reside in the jest root directory. This is necessary because the config file can then give the cache location, but it will be relative to its own location (not that of the jest config)
Heya, I think I've fixed this in the associated pull request. I'm currently testing to verify at our org, but would be curious to hear if it helps you all. You can try it using the version |
Partially addresses piglovesyou#605 Sets a new cwd context in cases where the config file does not reside in the jest root directory. This is necessary because the config file can then give the cache location, but it will be relative to its own location (not that of the jest config)
Firstly, great tool, super useful!
I was trying to move all my *.graphql files into a separate internal private package (specifically monorepo). While struggling with includes, paths, webpack, typescript etc, I think I stumbled upon a discrepancy in cacheDir usage.
If no
cacheDir
is set, the folder (node_modules.cache\graphql-let) seems it is always generated relatively to the .graphql-let.yml file. Even if you use in another package something likegraphql-let --config ../packages/graphql/.graphql-let.yml
.However, if you set
cacheDir
, the cache folder is placed relatively to the location graphql-let is run from. It feels that both of these should behave similar (relative vs absolute paths).P.S. Maybe related, paths specified in
schema
are relative to where graphql-let is executed and not where the configuration file is placed. Not sure, but in my use case, it would be better if the paths are all relative to the location of the .graphql-let.yml file. Curious what you think.The text was updated successfully, but these errors were encountered: