Is there a simple way to query the db from inside ...
# prisma-whats-new
i
Is there a simple way to query the db from inside a schema extension?
d
The easiest way is to use graphcool-lib. In a schema extension, you can construct an instance from the event:
const fromEvent = require('graphcool-lib').fromEvent module.exports = function(event) { return api.request(
Copy code
query {
		[GraphQL Query Here]
	}
) .catch((error) => { return { error: error.toString() } }) }
i
Thanks!
You just saved me a couple hours implementing a webhook