The Wayback Machine - https://web.archive.org/web/20220323083733/https://github.com/dotansimha/graphql-code-generator/pull/2978
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

Introduce typescript-generic-sdk plugin #2978

Merged
merged 4 commits into from Feb 4, 2020

Conversation

akozhemiakin
Copy link
Contributor

@akozhemiakin akozhemiakin commented Nov 17, 2019

Possible solution for #2415 which abstracts over concrete graphql client implementation

@akozhemiakin
Copy link
Contributor Author

@akozhemiakin akozhemiakin commented Nov 18, 2019

It would be awesome to have higher kinded types feature in typescript to abstract over wrapper type. For example apollo return result in some wrapper and with this generic implementation we forced to unwrap it in requester.

@dotansimha
Copy link
Owner

@dotansimha dotansimha commented Nov 24, 2019

Very nice! I think the effort of having to create a wrapper for client is fine.
I'll review it soon :)

Thanks @akozhemiakin !

@akozhemiakin
Copy link
Contributor Author

@akozhemiakin akozhemiakin commented Nov 24, 2019

Thank you for the response and for the great project. I just pushed another commit which allows to pass options to the requester.
Also I really want to find a way to generalize output type. Maybe I'll give a try to fp-ts HKT or something like that. In Scala it would be painless, but Typescript, unfortunately doesn't have so much power it its type system yet.

@akozhemiakin
Copy link
Contributor Author

@akozhemiakin akozhemiakin commented Nov 24, 2019

Btw, here is the Apollo requester implementation created to be used with this plugin:
https://gist.github.com/akozhemiakin/731b0c1e99eb89b01f80f08f9146b6b6

@dotansimha
Copy link
Owner

@dotansimha dotansimha commented Feb 4, 2020

Sorry for the delay, @akozhemiakin .
We are currently working on a library that could use that feature, so I'm reviewing and testing it now. I assume we can merge this very soon.

@dotansimha dotansimha marked this pull request as ready for review Feb 4, 2020
@dotansimha dotansimha merged commit 8b8eb88 into dotansimha:master Feb 4, 2020
1 check passed
@dotansimha
Copy link
Owner

@dotansimha dotansimha commented Feb 4, 2020

Merged, I also pushed a fix to align the version number in package.json (and also some internal API changes we recently did)
Alpha will be available very soon.

@dotansimha
Copy link
Owner

@dotansimha dotansimha commented Feb 4, 2020

Alpha version now available: 1.12.2-alpha-085fe906.18.

@DrChrispoper
Copy link

@DrChrispoper DrChrispoper commented Feb 26, 2021

I can only find documentation for typescript-graphql-request. Does this mean there is no typescript-generic-sdk or as #3458 sugguests there is just no documentation for it. I am looking to use it with Apollo Client.

@akozhemiakin
Copy link
Contributor Author

@akozhemiakin akozhemiakin commented Feb 26, 2021

@DrChrispoper First of all, take my excuses for not providing docs along with the original request, I'll try to schedule it.

Meanwhile, have you seen this gist?
https://gist.github.com/akozhemiakin/731b0c1e99eb89b01f80f08f9146b6b6

It is how we use typescript-generic-sdk with Apollo in our project.

@DrChrispoper
Copy link

@DrChrispoper DrChrispoper commented Feb 26, 2021

Thanks for reaching out so fast, yeah I've seen it thanks! The docs would be great mainly to know that it exists hehe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants