graphql-mesh
graphql-mesh copied to clipboard
fix(build): use correct path for relative imports of external modules + bracket notation
Description
Rolled up two issues as they both only required minor fixes:
Issue 1
Currently using build with external modules that are specified by relative path only work when the --dir
equals root of the workspace. Any relative import is always expressed in relation to the root workspace directory instead of in relation to the baseDir
.
Issue 2
When using a built mesh with additional resolvers from within a typescript project the compiler was complaining about either missing .resolvers
or .default
. This was easily mitigated by using bracket notation.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
Checklist:
- [x] I have followed the CONTRIBUTING doc and the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests and linter rules pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
Further comments
I have tested this locally as we were trying to get mesh build up and running in the context of an nx workspace.
Let me know if I should create a change set or wait for #2970 to create a single PR + changeset.
⚠️ No Changeset found
Latest commit: 10cacb75d05c57e3c1a5835e0dc8a7a611d6e3da
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@ardatan Sry for the flood of PRs, we have been migrating to mesh build (using mesh inside a sub directory in an nx project) and we have been running into these as the migration progresses.
Thanks for the PR! I think this has been fixed in the recent releases. If not, let me know :)