h-REA / hREA

A ValueFlows / REA economic network coordination system implemented on Holochain and with supplied Javascript GraphQL libraries
https://docs.hrea.io
Other
142 stars 15 forks source link

throw 'unimplemented' errors for API queries that aren't and won't be implemented within MMR scope #323

Closed Connoropolous closed 1 year ago

Connoropolous commented 2 years ago

currently, when you graphql request for Agent.relationships, for example, you just get null. Preferable would be to get an error back, informing the developer the endpoint isn't implemented yet. Otherwise they won't know if they're just getting a normal null field or an unimplemented one.

Query

This would all happen here: https://github.com/h-REA/hREA/tree/sprout/modules/vf-graphql-holochain/queries

Mutation

Resolvers

The rest would all happen here: https://github.com/h-REA/hREA/tree/sprout/modules/vf-graphql-holochain/resolvers

Agent

Agreement

Commitment

Fulfillment

Fine

Intent

Measure

Fine

Economic Event

Economic Resource

Plan

Process

Process Specification

This file is missing completely, and should be added. The resolvers can remain unimplemented, but the following should exist:

Proposal

Proposed Intent

Fine

ProposedTo

Fine

Resource Specification

Satisfaction

Fine (except that I am noting that the resolvers should be made conditional on VfModules enabled

Connoropolous commented 2 years ago

@pospi and @weswalla FYI I am beginning the effort to try to document which relational edges, of those that are enabled in DEFAULT_VF_MODULES, are actually implemented. Even if something is going to get done soon-ish, its still worthwhile to do this since it gets us all on the same page, and allows for any that do end up falling out of scope.

I am using the Graphql Explorer + the modules/vf-graphql-holochain files to check.

weswalla commented 2 years ago

How would we do this? Define a custom gql error type and throw it in all the above resolver functions?

Connoropolous commented 2 years ago

I think it would just look like a regular javascript error, which is like

throw new Error('error message goes here')
Connoropolous commented 2 years ago

@weswalla as soon as I can I'll continue my review of these, and post the rest. This for sure wasn't all of them. It was just quite a manual process to figure them out case by case