` "logs": [ { "2017-11-12T16:23:52.765Z"...
# prisma-whats-new
s
Copy code
"logs": [
    {
      "2017-11-12T16:23:52.765Z": "Error: endpoint is required!\n    at new Transport (/var/task/node_modules/lokka-transport-http/dist/in         dex.js:84:13)\n    at Object.<anonymous> (/var/task/src/lokka/lokka_client.js:8:16)\n    at Module._compile (module.js:570:32)\n    at Obj         ect.Module._extensions..js (module.js:579:10)\n    at Module.load (module.js:487:32)\n    at tryModuleLoad (module.js:446:12)\n    at Func         tion.Module._load (module.js:438:3)\n    at Module.require (module.js:497:17)\n    at require (internal/module.js:20:19)\n    at Object.<a         nonymous> (/var/task/src/updTmOnUsrAccStatChng.js:2:19)\nRequestId: de5caed5-c7c5-11e7-a5ff-f3f59f6f585e Process exited before completing          request"
    }
a
It seems you have migrated a function that uses
graphcool-lib
, but does not call
fromEvent(event)
Do you have any old hooks or subscriptions that manually construct the event context?
s
Ah damn, all my functions are like that. I just migrated them directly from a legacy project. I haven't refactored (and not sure precisely how to). They do not manually construct the event context, no.
Is there a doc that explains how to build serverless functions in the framework vs the legacy console way? Just trying to wrap my head around how they work now and how to refactor them.
a
I know only about this: https://www.graph.cool/docs/reference/service-definition/legacy-console-projects-aemieb1aev But that doesn't describe the actual changes to functions
s
Yeah, I used that to migrate the project itself. Worked great.
Now none of my functions work
lol
a
The most important change is that all function types now support:
Copy code
const graphcool = fromEvent(event)
const api = graphcool.api('simple/v1')
s
So prior, all I did was access the event from the input variable. Now I access the event from fromEvent(event)?
a
No, for those functions where you use
graphcool-lib
to talk 'back' to your Graphcool API
Accessing data from event hasn't changed. That's still just
event.data.whatEver
s
Ahh
So I just need to import graphcool-lib
a
Yes, and
npm/yarn
install it
s
It's installed
Just didn't realize I had to import it manually. Let's see how this works 🙂
👍🏻 1
Is graphcool-lib still the recommended approach for querying the api from within functions?
a
Yes
parrotwave1 1
s
Moment of truth
BOOM!
refactored for graphcool-lib and graphql-request
all working
a
chickawawa
s
Ty so much
Docs are still being developed (understandably), so the migration piece is a bit confusing still
a
I'm glad it worked out well for you
n
@senorcodecat could you please add this of information to the Github issue for this topic? 🙂
s
Yes sir. Which topic?
n
https://github.com/graphcool/framework/issues/1186
Docs are still being developed (understandably), so the migration piece is a bit confusing still
whatever it is that helped you out with your question now 😄
s
On this today @nilan