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

Allow MockStore get and set methods to successfully handle input types #6425

Open
oalexander opened this issue Aug 9, 2024 · 0 comments
Open

Comments

@oalexander
Copy link
Contributor

Is your feature request related to a problem? Please describe.

While working with an implementation that uses a MockStore, I have come across cases where inputs for mutations need to be stored to be used in subsequent calls. A base use case would be the CRUD operations done on a resource where the update requires the object to exist beforehand. For now, it appears that the resolver responses are automatically stored (which is great), but a user cannot manually store or retrieve an input type in the MockStore.

Describe the solution you'd like

The get and set methods within the MockStore successfully store and retrieve an input type if it is defined within the schema.

Describe alternatives you've considered

I'm able to achieve this functionality by creating an extended class from MockStore and "overwriting" the private getType function. It seems to work fine, but I'm sure there are edge-cases and scenarios I'm not aware of. It also doesn't feel great hacking a way to change a private method.

Another alternative is to not use the MockStore for this functionality at all. There are definitely use cases where that makes sense, but the generally functionality still seems like a general use case.

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

1 participant