Many usecases for graphcool-lib use the library in an Express webtask. It would be nice if the library could expose an Express middleware function (like bodyParser.json()) to easily use it in Express. I now use this middleware function to make the api available directly from the req object:
Many usecases for
graphcool-lib
use the library in an Express webtask. It would be nice if the library could expose an Express middleware function (likebodyParser.json()
) to easily use it in Express. I now use this middleware function to make the api available directly from thereq
object:With the function exposed from
graphcool-lib
, this can become: