{"action":"created","issue":{"url":"https://api.github.com/repos/prisma/prisma/issues/2942","repository_url":"https://api.github.com/repos/prisma/prisma","labels_url":"https://api.github.com/repos/prisma/prisma/issues/2942/labels{/name}","comments_url":"https://api.github.com/repos/prisma/prisma/issues/2942/comments","events_url":"https://api.github.com/repos/prisma/prisma/issues/2942/events","html_url":"https://github.com/prisma/prisma/issues/2942","id":351851514,"node_id":"MDU6SXNzdWUzNTE4NTE1MTQ=","number":2942,"title":"Bug: When Subscription has fragments but is NOT named Prisma returns null right away and closes subscription","user":{"login":"ntziolis","id":265338,"node_id":"MDQ6VXNlcjI2NTMzOA==","avatar_url":"https://avatars2.githubusercontent.com/u/265338?v=4","gravatar_id":"","url":"https://api.github.com/users/ntziolis","html_url":"https://github.com/ntziolis","followers_url":"https://api.github.com/users/ntziolis/followers","following_url":"https://api.github.com/users/ntziolis/following{/other_user}","gists_url":"https://api.github.com/users/ntziolis/gists{/gist_id}","starred_url":"https://api.github.com/users/ntziolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntziolis/subscriptions","organizations_url":"https://api.github.com/users/ntziolis/orgs","repos_url":"https://api.github.com/users/ntziolis/repos","events_url":"https://api.github.com/users/ntziolis/events{/privacy}","received_events_url":"https://api.github.com/users/ntziolis/received_events","type":"User","site_admin":false},"labels":[{"id":502079660,"node_id":"MDU6TGFiZWw1MDIwNzk2NjA=","url":"https://api.github.com/repos/prisma/prisma/labels/area/subscriptions","name":"area/subscriptions","color":"fbca04","default":false},{"id":918549676,"node_id":"MDU6TGFiZWw5MTg1NDk2NzY=","url":"https://api.github.com/repos/prisma/prisma/labels/component/server","name":"component/server","color":"d4c5f9","default":false},{"id":972213211,"node_id":"MDU6TGFiZWw5NzIyMTMyMTE=","url":"https://api.github.com/repos/prisma/prisma/labels/status/repro-available","name":"status/repro-available","color":"a9c1e8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-18T20:51:23Z","updated_at":"2018-11-14T02:33:29Z","closed_at":"2018-09-28T16:03:54Z","author_association":"CONTRIBUTOR","body":"**Summary**\r\nWhen using fragments + NOT naming the subscription Prisma (not app endpoint) returns `{ data: null }` straight away  + closes the connection (no spinner in playground).\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n\r\n1. Feel free to use my endpoint: https://eu1.prisma.sh/public-silvermole-100/subscription-fragment/dev\r\nor\r\nCreate new service in prisma with the following schema:\r\n```\r\ntype Post {\r\n  id: ID! @unique\r\n}\r\n```\r\n2. Execute the below in playground against prisma endpoint\r\n```\r\nfragment PostFragment on Post{\r\n  id\r\n}\r\nsubscription {post{node{  ...PostFragment  }}}\r\n```\r\n3. See error\r\nReturns `{ data: null }` straight away  + closes the connection (no spinner in playground)\r\n\r\n**Expected behavior**\r\nSubscription not be closed (spinning wheel in playground). Data should be returned when there is an event the subscription matches.\r\n\r\n**Screenshots**\r\nIf applicable, add screenshots to help explain your problem.\r\n\r\n**Versions (please complete the following information):**\r\n - Prisma Server: 1.15-beta-1 (current dev servers)\r\n\r\n**Context**\r\nWhen either giving the subscription a name or removing the fragments it works just fine (spinning wheel in playground):\r\n```\r\nfragment PostFragment on Post{\r\n  id\r\n}\r\nsubscription SomeName{post{node{  ...PostFragment  }}}\r\n```\r\nor\r\n```\r\nsubscription {post{node{  id  }}}\r\n```"},"comment":{"url":"https://api.github.com/repos/prisma/prisma/issues/comments/438515462","html_url":"https://github.com/prisma/prisma/issues/2942#issuecomment-438515462","issue_url":"https://api.github.com/repos/prisma/prisma/issues/2942","id":438515462,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODUxNTQ2Mg==","user":{"login":"mcmar","id":8251430,"node_id":"MDQ6VXNlcjgyNTE0MzA=","avatar_url":"https://avatars3.githubusercontent.com/u/8251430?v=4","gravatar_id":"","url":"https://api.github.com/users/mcmar","html_url":"https://github.com/mcmar","followers_url":"https://api.github.com/users/mcmar/followers","following_url":"https://api.github.com/users/mcmar/following{/other_user}","gists_url":"https://api.github.com/users/mcmar/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmar/subscriptions","organizations_url":"https://api.github.com/users/mcmar/orgs","repos_url":"https://api.github.com/users/mcmar/repos","events_url":"https://api.github.com/users/mcmar/events{/privacy}","received_events_url":"https://api.github.com/users/mcmar/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T02:33:29Z","updated_at":"2018-11-14T02:33:29Z","author_association":"NONE","body":"@marktani This isn't a bug with `graphql-playground`. I'm inspecting the traffic and `graphql-playground` is correctly sending it over a websocket. I can even see the individual websocket frames.\r\nThis is a bug with `prisma-binding` and I can confirm that because this bug is not present when I send a subscription directly to my prisma backend. However, it is present when I send the subscription with `prisma-binding`. I can even see that `graphql-playground` sends it as a websocket, but when I enable `debug` on `prisma-binding`, it logs the following:\r\n```\r\nRequest to http://hash.us-west-2.elb.amazonaws.com/vibely/prod:\r\nquery:\r\nsubscription ($_v0_where: ChatRoomMessageSubscriptionWhereInput) {\r\n  chatRoomMessage(where: $_v0_where) {\r\n    node {\r\n      ...Message\r\n    }\r\n  }\r\n}\r\n\r\nfragment Message on ChatRoomMessage {\r\n  id\r\n}\r\noperationName: null\r\nvariables:\r\n{\r\n  \"_v0_where\": {\r\n    \"mutation_in\": [\r\n      \"CREATED\"\r\n    ],\r\n    \"node\": {\r\n      \"chatRoom\": {\r\n        \"id\": \"REDACTED\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nScreenshots included for proof:\r\n<img width=\"1440\" alt=\"screen shot 2018-11-13 at 6 29 01 pm\" src=\"https://user-images.githubusercontent.com/8251430/48456010-41248300-e772-11e8-905a-0f248ef6937a.png\">\r\n\r\nI hope that this evidence is sufficient to prove my case. I think we should close the issue with `graphql-playground` because no such issue exists and open a new issue with `prisma-binding` so we can fix this."}}
{"actor":{"display_login":"mcmar"}}