{"action":"created","issue":{"url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/14","repository_url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket","labels_url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/14/comments","events_url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/14/events","html_url":"https://github.com/absinthe-graphql/absinthe-socket/issues/14","id":294786754,"number":14,"title":"Cannot read property \"find\" of undefined react-native","user":{"login":"octavonce","id":20557383,"avatar_url":"https://avatars1.githubusercontent.com/u/20557383?v=4","gravatar_id":"","url":"https://api.github.com/users/octavonce","html_url":"https://github.com/octavonce","followers_url":"https://api.github.com/users/octavonce/followers","following_url":"https://api.github.com/users/octavonce/following{/other_user}","gists_url":"https://api.github.com/users/octavonce/gists{/gist_id}","starred_url":"https://api.github.com/users/octavonce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octavonce/subscriptions","organizations_url":"https://api.github.com/users/octavonce/orgs","repos_url":"https://api.github.com/users/octavonce/repos","events_url":"https://api.github.com/users/octavonce/events{/privacy}","received_events_url":"https://api.github.com/users/octavonce/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-06T14:50:26Z","updated_at":"2018-02-06T15:10:06Z","closed_at":"2018-02-06T15:10:06Z","author_association":"NONE","body":"Hello!\r\n\r\nI am trying to set up subscriptions on a react-native app but i am receiving the following error:\r\n![screen shot 2018-02-06 at 16 49 00](https://user-images.githubusercontent.com/20557383/35865659-c24dc866-0b5d-11e8-88eb-bafc791a9b45.png)\r\n\r\nThis is the subscription handler which works perfectly on the web side:\r\n```javascript\r\nconst SubscriptionSocket = async (url, logger) => {\r\n  const API_TOKEN = await AsyncStorage.getItem('API_TOKEN');\r\n\r\n  return AbsintheSocket.create(\r\n    new Socket(`${WS_URL}/socket`, {\r\n      logger,\r\n      params: { jwt: API_TOKEN }\r\n    })\r\n  );\r\n}\r\n\r\nfunction subscriptionHandler(subscriptionConfig, variables, cacheConfig, observer) {\r\n  const socket = new SubscriptionSocket(WS_URL, (kind, msg, payload) => { \r\n    if (typeof payload !== 'undefined' && payload.subscriptionId) {\r\n      observer.onNext({ data: payload.result.data });\r\n    } else {\r\n      if (process.env.NODE_ENV === 'development') {\r\n        console.log(`${kind.toUpperCase()} ${msg}`, payload);\r\n      }\r\n    }\r\n  });\r\n  \r\n  AbsintheSocket.send(socket, { operation: subscriptionConfig.text, variables });\r\n  \r\n  return { \r\n    dispose: () => socket.phoenixSocket.disconnect(() => {\r\n      if (process.env.NODE_ENV === 'development') {\r\n        console.log(`DISPOSE \\n${subscriptionConfig.text}`);\r\n      }\r\n    })\r\n  };\r\n}\r\n```\r\n\r\nThis is currently a blocker for us so any help would be appreciated. "},"comment":{"url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/comments/363451451","html_url":"https://github.com/absinthe-graphql/absinthe-socket/issues/14#issuecomment-363451451","issue_url":"https://api.github.com/repos/absinthe-graphql/absinthe-socket/issues/14","id":363451451,"user":{"login":"octavonce","id":20557383,"avatar_url":"https://avatars1.githubusercontent.com/u/20557383?v=4","gravatar_id":"","url":"https://api.github.com/users/octavonce","html_url":"https://github.com/octavonce","followers_url":"https://api.github.com/users/octavonce/followers","following_url":"https://api.github.com/users/octavonce/following{/other_user}","gists_url":"https://api.github.com/users/octavonce/gists{/gist_id}","starred_url":"https://api.github.com/users/octavonce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octavonce/subscriptions","organizations_url":"https://api.github.com/users/octavonce/orgs","repos_url":"https://api.github.com/users/octavonce/repos","events_url":"https://api.github.com/users/octavonce/events{/privacy}","received_events_url":"https://api.github.com/users/octavonce/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T15:10:06Z","updated_at":"2018-02-06T15:10:06Z","author_association":"NONE","body":"I was returning a promise from the SubscriptionSocket constructor, sorry for posting the issue."}}
{"actor":{"display_login":"octavonce"}}