Skip to content

@defer and @stream not working for federated subgraphs #1675

@aarne

Description

@aarne

A fairly typical pattern for @stream and @defer seems to be not working? I'm not sure if this is a regression in the version I'm using or it a bug.

query {
  goToSubgraphAndExecute {
    fastField1
    ... on ResponseType @defer {
      slowField1
    }
    progress @stream {
      id
      status
    }
  }
}

While the query works as expected directly via gateway the result is all nulls, But no error also :(

---
{"data":{"goToSubgraphAndExecute":{"fastField1":null,"progress":null,"__typename":"ResponseType"}},"hasNext":true}
---
{"incremental":[{"data":{"slowField1":null,"__typename":"ResponseType"},"path":["goToSubgraphAndExecute"]}],"hasNext":false}
-----

directly the response looks like this

---
{"data":{"goToSubgraphAndExecute":{"fastField1":true,"progress":[]}},"hasNext":true}
---
{"incremental":[{"items":[{"id":"1","status":"ok"}],"path":["goToSubgraphAndExecute","progress",0]}],"hasNext":true}
---
{"incremental":[{"data":{"slowField1":{...},"path":["goToSubgraphAndExecute"]}],"hasNext":true}
---
{"hasNext":false}
-----

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions