(payload: Payload)
| 62 | } |
| 63 | |
| 64 | const onCompleted = (payload: Payload) => { |
| 65 | if (!payload.createGithubSession) { |
| 66 | console.log('createGithubSession field missing from response:', payload) |
| 67 | done(null, null) |
| 68 | return |
| 69 | } |
| 70 | |
| 71 | const { createGithubSession } = payload |
| 72 | const userEdge = createGithubSession?.userEdge |
| 73 | const sessionEdge = createGithubSession?.sessionEdge |
| 74 | console.log('User fetched from api, saving to session', userEdge, sessionEdge) |
| 75 | const id = userEdge && userEdge.node && userEdge.node.id |
| 76 | const sessionId = sessionEdge?.node?.id |
| 77 | done(null, { id, sessionId }) |
| 78 | } |
| 79 | |
| 80 | const onError = (error: Error) => { |
| 81 | console.log('Something happened:', error) |
nothing calls this directly
no outgoing calls
no test coverage detected