-
Notifications
You must be signed in to change notification settings - Fork 473
Open
Description
Describe the bug
While testing our backend with urql, we noticed that the urql code seemed to work only if the first element did not contain payload. (see attached screenshot). This is related to subscriptions when using multipart.
It seems that after result is not null, payload can be used as the root element
Related To: #3499
Reproduction client
const { Client, cacheExchange, fetchExchange } = require('@urql/core');
const client = new Client({
url: 'http://localhost:3002/graphql',
exchanges: [
cacheExchange, fetchExchange
],
fetchSubscriptions: true,
fetchOptions: () => {
return {
headers: {
accept: 'multipart/mixed;boundary="graphql"'
},
};
},
});
async function query() {
const QUERY = `
subscription Test {
countEmp2(max: 5, intervalMilliseconds: 1000)
}
`;
const { unsubscribe } = client.subscription(QUERY).subscribe(result => {
result.data
console.log(result.data); // { data: ... }
});
}
query();
Reproduction
Reproduction Is In Description, don't have a backend available to share atm
Urql version
@urql/core, 5.1.1
Validations
- I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
- Read the docs.
- Follow our Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels