Skip to content
New issue

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

Subscription errors get lost when merging schemas #793

Closed
1 of 5 tasks
dh94 opened this issue May 19, 2018 · 2 comments
Closed
1 of 5 tasks

Subscription errors get lost when merging schemas #793

dh94 opened this issue May 19, 2018 · 2 comments
Labels
feature New addition or enhancement to existing solutions has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository

Comments

@dh94
Copy link
Contributor

dh94 commented May 19, 2018

I think this issue is since mergeSchemas was introduced,
when merging a schema that contains subscriptions the errors that are thrown from the reducers
are lost from the result

Intended outcome: subscription fields errors should be included after merging schemas as well

Actual outcome: errors are lost, for example
for the following subscription:

type TimeQuery {
    time: String
    throwError: Boolean
}

type Subscription {
    tellMeTime: TimeQuery
}

subscription {
  tellMeTime {
    time
    throwError
  }
}

when not using mergeSchema this is the subscription result:

{
    "type": "data",
    "id": "2",
    "payload": {
        "errors": [{
            "message": "",
            "locations": [{
                "line": 4,
                "column": 5
            }],
            "path": ["tellMeTime", "throwError"]
        }],
        "data": {
            "tellMeTime": {
                "time": "11:22:29",
                "throwError": null
            }
        }
    }
}

and when I am using mergeSchemas this is the subscription result

{
    "type:" "data",
    "id": "2",
    "payload": {
        "data": {
            "tellMeTime": {
                "time": "11:09:02",
                "throwError": null
            }
        }
    }
}

How to reproduce the issue:
I created a WebSocket server like
https://www.apollographql.com/docs/graphql-subscriptions/setup.html#subscription-server
and gave it the following schema:
https://gist.github.com/dh94/1dec5c54ecdb9c20e52985fff4ccaa6b#file-merged-schema-ts

packages version used:

    "apollo-server-express": "^1.3.6",
    "express": "^4.16.2",
    "graphql": "^0.13.1",
    "graphql-subscriptions": "^0.5.8",
    "graphql-tools": "^3.0.1",
    "subscriptions-transport-ws": "^0.9.9",
    "typescript": "^2.7.2"
  • has-reproduction
  • feature
  • docs
  • blocking
  • good first issue
@ghost ghost added has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository feature New addition or enhancement to existing solutions labels May 19, 2018
@dh94
Copy link
Contributor Author

dh94 commented May 20, 2018

from what i gathered it looks directly related to this issue,
#780
i'll try to create a pull request handling this

@hwillson
Copy link
Contributor

hwillson commented Sep 7, 2018

Closing as this was likely addressed by #795. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository
Projects
None yet
Development

No branches or pull requests

2 participants