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

Remove unwraps #45

Closed
obmarg opened this issue Jun 14, 2020 · 0 comments · Fixed by #49
Closed

Remove unwraps #45

obmarg opened this issue Jun 14, 2020 · 0 comments · Fixed by #49

Comments

@obmarg
Copy link
Owner

obmarg commented Jun 14, 2020

There are some places where I've been lazy and stuck unwraps. Should remove them

obmarg added a commit that referenced this issue Jun 14, 2020
obmarg added a commit that referenced this issue Jun 14, 2020
Prior to this change we serialized arguments when building up the
selection set, and stored the results of that serialization in the
Argument struct.  This worked, but led to an awkward API where you build
the selection set, convert it to a QueryBody which could fail, and
_then_ convert it to JSON which could also fail.

This updates the Argument struct to store a `Box<SerializableArgument>`
instead.  This simplifies things: we can now serialize the Query
directly, and the Argument serialization will happen there, leading to a
single point of failure rather than multiple.

Also updated the serialize & encode functions to return `Box<Error> `
rather than `()`.

Fixes #42
Fixes #45
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

Successfully merging a pull request may close this issue.

1 participant