-
Notifications
You must be signed in to change notification settings - Fork 1
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
Handle aliases in graphql-flow. #68
Conversation
🦋 Changeset detectedLatest commit: 89cfb22 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
pathWithoutExtension: string, | ||
config: Config, | ||
): string => { | ||
// Process the path so that we can handle aliases. |
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 is the new change.
expect(result).toBe(""); | ||
}); | ||
|
||
it("maps aliases to their correct 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 is the test confirming that it works.
generate: GenerateConfig | Array<GenerateConfig> | ||
crawl: CrawlConfig; | ||
generate: GenerateConfig | Array<GenerateConfig>; | ||
alias?: Array<{ |
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 is the format of the new alias config setting.
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.
LGTM. Did we only recently run into issues with graphql-flow having troubles traversing ~/
style imports?
Thanks for fixing all of the tooling in this repo. Sorry for missing that during the TypeScript upgrade.
@kevinb-khan So it turns out that I hit this during: https://github.com/Khan/webapp/pull/23926 we were hitting issues where we were importing GraphQL fragments across packages using a |
Summary:
This adds a new option to the config for graphql-flow so that you can specify aliases to map to, to help resolve imports. I used the same format as Vite to keep things simple. This will make it so that we can support our
~/
-style imports.In the process I realized a number of things about this repo were broken, so I fixed them:
Hopefully this helps things to run more smoothly!
Issue: FEI-5745
Test plan:
I ran
yarn tsc
andyarn eslint src/**/*.ts
and they both passed.