Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

avoid 500 errors for erroring mutation payloads #121

Open
camallen opened this issue May 20, 2020 · 1 comment
Open

avoid 500 errors for erroring mutation payloads #121

camallen opened this issue May 20, 2020 · 1 comment

Comments

@camallen
Copy link
Contributor

Linked to #120 - convert the mutation error handling to add useful messaging to the response object (idiomatic graphql) and add custom error reporting events in the mutation code.

This would also require a modification to the lambda processing code to reflect on the response object errors key combined with HTTP error codes to determine processing failures.

@camallen
Copy link
Contributor Author

see details in the comment

# Note: any import errors above will raise now
# (500 response) for the incoming mutation request
#
# Using 500 response status is not idomatic graphql
# but it is the easiest way to handle the lamdba function error processing
# as it stands, https://github.com/zooniverse/zoo-stats-api-graphql/blob/965ac156ad38281458fe347fdf9be5a21249db6d/kinesis-to-http/zoo-stats-api-graphql.py#L20
#
# Noting that graphql end points will return 200 even for errored states
# https://graphql-ruby.org/mutations/mutation_errors
# https://github.com/rmosolgo/graphql-ruby/blob/master/guides/errors/execution_errors.md
#
# the following error payloads ast it stands is useless now
# but is a placeholder to convert to errors as data in futur
# and modification of the lambda function result handler
# to check the response payloads for error states

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

No branches or pull requests

1 participant