-
Notifications
You must be signed in to change notification settings - Fork 1
Easier context binding with instantiation expressions #42
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7b6cc46 to
acc5be9
Compare
acc5be9 to
f7302fe
Compare
1d51000 to
663b3d2
Compare
40a79d8 to
d4a7a5d
Compare
663b3d2 to
5eafeea
Compare
d4a7a5d to
e647ef6
Compare
5eafeea to
b502533
Compare
affb9c2 to
43657cc
Compare
43657cc to
fc72620
Compare
b502533 to
083a8e5
Compare
21d867e to
45879c5
Compare
|
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
45879c5 to
5d6be9c
Compare
68ba251 to
802c741
Compare
802c741 to
4f3ab67
Compare
2ac2e9c to
81768d4
Compare
7fe3d80 to
41a7d27
Compare
21e0807 to
4c7902e
Compare
4c7902e to
e957227
Compare
e957227 to
5fb2a5e
Compare
5fb2a5e to
00af7c4
Compare
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #41 attempting to solve the same problem.
Instead of the big type definition of
g,gis defined as "get the return type of the function but if the function takes no arguments and the function returns a function that does take arguments, get the return type of that function". So this can be used with the functions likeg.object+ instantiation expressions. This is definitely a much neater design than #40 and nicely has less API going on but it has some problems:OutputType/etc.typeofandg.and<...>syntax clutter up definitions a lotWhile these problems aren't great, I think they're probably the right trade-offs and for cases where
g<typeof g.something<...>>don't work, people can use the exports from@graphql-ts/schemaespecially since those cases are much more advanced use cases.Here's the same example as in #41 but using this