Skip to content

Instantly share code, notes, and snippets.

View wiktor256's full-sized avatar

Wiktor Kozlik wiktor256

View GitHub Profile
@wiktor256
wiktor256 / gql-test.js
Last active February 24, 2025 10:26
Program that shows performance degradation of graphQL when resolver returns a promise.
/**
* Program that shows performance degradation of graphQL when resolver returns a promise.
* See Book.author() resolver below.
*
* Usage:
* (1) run graphQL query with synchronous resolver
* node gql-test limit=100000 async=0
* (2) run graphQL query with asynchronous resolver
* node gql-test limit=100000 async=1
* Sample results: