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

contextType path starts with "#" #7762

Closed
Tracked by #198
sarink opened this issue Apr 12, 2022 · 7 comments · Fixed by #9845
Closed
Tracked by #198

contextType path starts with "#" #7762

sarink opened this issue Apr 12, 2022 · 7 comments · Fixed by #9845
Labels
core Related to codegen core/cli

Comments

@sarink
Copy link

sarink commented Apr 12, 2022

Node supports subpath imports as long as the import begins with #. However, the way that contextType works is by looking for an exported variable name after the #

That means if your context file is located in an aliased subpath, ie "#api/src/context#Context", the generated types will have an import which cannot be resolved.

Suggestion: Consider using a different character, since Node has already claimed # in import paths

@charlypoly charlypoly added the core Related to codegen core/cli label Nov 3, 2022
@productdevbook
Copy link
Contributor

same problem contextType: '#pergel-graphql#PergelGraphQLContext',

@dotansimha
Copy link
Owner

I assume the only solution here is allowing to escape # with something like \\#?
@saihaj what do you think?

@productdevbook
Copy link
Contributor

Can we please resolve this? It's getting in the way. :( Thank you

@productdevbook
Copy link
Contributor

enumValues: {
  RoleStatus: '#changeName/server/drizzle/schema#RoleStatus',
}

enumValues same problem

@saihaj
Copy link
Collaborator

saihaj commented Feb 8, 2024

@productdevbook do you want to send a PR with a failing test case and a potential fix?

@productdevbook
Copy link
Contributor

@productdevbook do you want to send a PR with a failing test case and a potential fix?

I wanted to, but I couldn't find where it was.

@productdevbook
Copy link
Contributor

@dotansimha @saihaj i am send pr please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to codegen core/cli
Projects
None yet
5 participants