graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Queries should return partial data if remote relationships fail

Open tirumaraiselvan opened this issue 1 year ago • 3 comments

Is your proposal related to a problem?

If there is a query with a remote relationships like below:

query {
  artists {
    name
    info
    remote_tracks {
      id
      title
    }
  }
}

where remote_tracks is a remote relationship and if there is a failure in the origin source for remote_tracks then graphql-engine should still return partial results for artists instead of throwing complete error.

Describe the solution you'd like

In the above example, if remote_tracks does not resolve because of intermittent network issues, etc then we should get a response like below:

{
  "data": {
    "artists": [
      {
      "name": "ac/dc",
      "info": "rock",
      "remote_info": null
      }
    ]
  },
  "errors": [
    {
      "message": "could not resolve remote_info"
    }
  ]
}

Scope/Notes

  1. Note that the remote source above is consistent in the metadata but fails to "resolve" during the execution of the request. Tackling partial success when the remote source is inconsistent (i.e when remote_info would not even be present in the schema) can be considered out of scope of this ticket.

tirumaraiselvan avatar Jun 30 '23 09:06 tirumaraiselvan