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

MockedProvider bindings #112

Closed
Arnarkari93 opened this issue Jun 1, 2021 · 4 comments
Closed

MockedProvider bindings #112

Arnarkari93 opened this issue Jun 1, 2021 · 4 comments

Comments

@Arnarkari93
Copy link
Contributor

How would we approach writing bindings for MockedProvider? The mocks prop is so dynamic and I am struggling where to begin. Has anybody thought about this?

@jeddeloh
Copy link
Owner

jeddeloh commented Jun 5, 2021

Hey, sorry for the slow reply. I'll take a look at this soon, but before I do, have you considered just writing a simple binding typed in the way you use it rather than trying to represent all the dynamic props?

@Arnarkari93
Copy link
Contributor Author

Isn't going to be an issue that rescript Apollo client is extended and defines a method rescript_query? I can't just make a simple binding for mockedProvider and say it is ApolloClient.t

@jeddeloh
Copy link
Owner

jeddeloh commented Jun 9, 2021

Ah, yes, sorry. I only used MockedProvider for a short while a long time ago and thought I remembered you being able to provide a client. This may be a pretty serious consequence of having gone the route of representing objects as records rather than keeping every method as a separate function.

I'm not sure the best way to proceed here. On the one hand, MockedProvider seems dead simple. It's mostly a convenience function for creating a client using MockLink and some teardown. Maybe just recreate it in rescript?

Thoughts?

@Arnarkari93
Copy link
Contributor Author

Sorry for the late response. Yes, I think recreating it in rescript is a good solution. I don't think I will be working with this library anytime soon, but If I do, I will check it out.

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

No branches or pull requests

2 participants