You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A subgraph library should be adhering to the GraphQL Spec when returning a response with data, errors, and extensions. However, if for some reason a subgraph returns an valid response the Router does not log or emit any info that this happened.
This kinda happens for invalid data. If a subgraph returns something bad about a data block the Router doesn't log anything to console but it does atleast change the GraphQL response to an error like so, like calling it foo instead of data
{
"message": "service 'users' response was malformed: graphql response without data must contain at least one error",
"path": [],
"extensions": {
"service": "users",
"reason": "graphql response without data must contain at least one error",
"code": "SUBREQUEST_MALFORMED_RESPONSE"
}
}
If the subgraph however returns a malformed GraphQL error in the errors array this fails with no logs and there is nothing in the Router response indicating that
eg if the path was incorrect then the Router just returns the data block and no errors at all
{"errors": [{"message": "can't fetch points for user user:1","locations": [{"line": 1,"column": 14}],"path": ["",// invalid text path here0,"loyaltyPoints"],"extensions": {"code": "INTERNAL_SERVER_ERROR"}}]}
To Reproduce
Start the router with the following config
include_subgraph_errors:
all: true
Return a subgraph response with an invalid error
Expected behavior
At a minimum we should see Router logs but also probably something about a parsing or validation errors for clients to see as well
Desktop (please complete the following information):
OS: macOS
Version 14.7.1
Router 1.57.1
The text was updated successfully, but these errors were encountered:
Describe the bug
A subgraph library should be adhering to the GraphQL Spec when returning a response with
data
,errors
, andextensions
. However, if for some reason a subgraph returns an valid response the Router does not log or emit any info that this happened.This kinda happens for invalid
data
. If a subgraph returns something bad about adata
block the Router doesn't log anything to console but it does atleast change the GraphQL response to an error like so, like calling itfoo
instead ofdata
If the subgraph however returns a malformed GraphQL error in the
errors
array this fails with no logs and there is nothing in the Router response indicating thateg if the
path
was incorrect then the Router just returns thedata
block and noerrors
at allTo Reproduce
Expected behavior
At a minimum we should see Router logs but also probably something about a parsing or validation errors for clients to see as well
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: