We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@defer
DataSource
As the title says, there seems to be an issue affecting @deferfields under some specific conditions. Let's say we have the following schema:
case class Bar( value: UQuery[String] // Backed by a datasource ) case class Foo(bar: UIO[List[Bar]]) case class Query(foo: UIO[Foo])
And I want to execute the following query:
foo { bar { ... @defer { value } } }
This works fine as long as no item in the list makes a request to the datasource that requires deduplication. e.g.,
case class Req(i: Int) extends Request[Nothing, String] val ds = DataSource.fromFunctionZIO("ValuesDS") { (_: Req) => ZIO.succeed("value").delay(50.millis) } def makeBar(i: Int): Bar = Bar(ZQuery.fromRequest(Req(i))(ds)) val works = Query(ZIO.succeed { Foo(bar = ZIO.succeed(List(makeBar(1), makeBar(2), makeBar(3)))) }) val broken = Query(ZIO.succeed { Foo(bar = ZIO.succeed(List(makeBar(1), makeBar(3), makeBar(3)))) })
What happens in the "broken" case is that the streamed messages look like this:
{"incremental":[{"data":null,"errors":[{"message":"Effect failure","locations":[{"line":6,"column":36}],"path":["foo","bar",0,"value"]}],"path":["foo","bar",0]}],"hasNext":true}
I managed to trace down the issue to the datasource not completing the requests, dying with the following message:
Data source ValuesDS did not complete request Req(3) ....
Data source ValuesDS did not complete request Req(3) ...
Note that if I change my query to this, then it works as expected again:
foo { ... @defer { bar { value } } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
As the title says, there seems to be an issue affecting
@defer
fields under some specific conditions. Let's say we have the following schema:And I want to execute the following query:
This works fine as long as no item in the list makes a request to the datasource that requires deduplication. e.g.,
What happens in the "broken" case is that the streamed messages look like this:
I managed to trace down the issue to the datasource not completing the requests, dying with the following message:
Data source ValuesDS did not complete request Req(3) ...
.Note that if I change my query to this, then it works as expected again:
The text was updated successfully, but these errors were encountered: