Introducing Resolver Functions


#1

Hi everyone!

We’re super excited to finally officially release Resolver functions :tada:

Resolvers are an extremely powerful concepts that have lots of potential use cases, for example:

  • Wrap an existing API (such as Stripe, Mailgun or a microservice)
  • Provide “shortcuts” to specific operations in your Graphcool CRUD API
  • Implement custom authentication workflows

You can read the full announcement on our blog or watch the ~6 min intro video.

We’re looking forward to see what you’re going to build with resolvers! Please let us know any feedback you might have :green_heart:


Feedback: Schema Extensions Beta
#2

Hi Nikolas,

I’m super excited for this new feature! However, could we improve the error log to be more readable? How would you debug a function in the console?

Thanks!

{"error":"Call to https://wt-graphcool.it.auth0.com/api/run/cj0pqf6vfq9fl01183k5iab0u/cj8e2skk5000q01p1adtcvepy failed with status 500, response body {\n  \"code\": 500,\n  \"error\": \"Script generated an unhandled synchronous exception.\",\n  \"details\": \"SyntaxError: Unexpected token {\",\n  \"name\": \"SyntaxError\",\n  \"message\": \"Unexpected token {\",\n  \"stack\": \"SyntaxError: Unexpected token {\\n    at exports.runInThisContext (vm.js:53:16)\\n    at Module._compile (module.js:373:25)\\n    at Module._compile (/data/sandbox/lib/module.js:127:21)\\n    at Object.Module._extensions..js (module.js:416:10)\\n    at Module.load (module.js:343:32)\\n    at Function.Module._load (module.js:300:12)\\n    at WebtaskModule.require (/data/sandbox/lib/module.js:101:19)\\n    at require (/data/sandbox/lib/module.js:136:21)\\n    at module.exports (/data/io/fca641f905e74a3cb853062253b71845/webtask.js:17:18)\\n    at /data/io/fca641f905e74a3cb853062253b71845/webtask.js:40:24\"\n} and headers [date: Thu, 05 Oct 2017 06:23:25 GMT | Connection: keep-alive | content-type: application/json | x-auth0-stats: {\"worker_pid\":1,\"response\":{\"200\":1,\"500\":1},\"time\":584,\"uptime\":210.849,\"memory\":{\"rss\":62087168,\"heapTotal\":39129344,\"heapUsed\":30325640,\"external\":120808}} | x-frame-options: DENY | transfer-encoding: chunked | x-auth0-proxy-stats: {\"proxy_host\":\"172.28.64.50\",\"proxy_pid\":19,\"container_id\":\"253c1c14-c4b4-40e4-a47d-5534853ec043\",\"latency\":644,\"uptime\":3235346.043,\"memory\":{\"rss\":105615360,\"heapTotal\":74225408,\"heapUsed\":55993424,\"external\":21185484},\"req_id\":\"1507184605189.560728\"} | x-wt-response-source: webtask]"}

#3

Hi @kingsten, thanks a lot for the feedback!

We’re aware that the debugging experience in the console isn’t perfect yet. With the upcoming release of the new CLI and the Graphcool Framework (stay tuned!), the DX around implementing, testing and debugging functions will become a lot better.

Feel free to try out the beta already today:

npm install -g graphcool@beta

#4

You can read more about the Framework preview here: Feedback: Framework Preview :slight_smile:

Also, the error message you receive usually means that there is a syntax error in your function.