vwkd / denokv-graphql

GraphQL bindings for Deno KV
https://deno.land/x/denokv_graphql
MIT License
11 stars 0 forks source link

Improve error messages #12

Open vwkd opened 1 year ago

vwkd commented 1 year ago
vwkd commented 1 year ago

The reasons for nullability are now mentioned in the README with https://github.com/vwkd/denokv-graphql/commit/e34f56fe5644f4df7c1bbc763f5195d7c491a79d

We continue returning null in a delete mutation instead of throwing a concurrent change error, because the versionstamps are given by user input and we don't want to throw for outdated user input, just like we don't throw for a non-existent id in a query.

We can think about nicer error messages by moving the return data validation in-house instead of leaving it to GraphQL later when the library is in a stable shape.

vwkd commented 1 year ago

Currently, a many query returns a pageInfo even if an error is thrown in the leaf resolver and the edges are empty. This is due to the root resolvers reading the id's only, and then the leaf resolver reading any selected fields. Not clear how to solve this.