[PR #5] refactor: Port to TypeScript #62

Closed
opened 2026-03-03 00:03:06 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/atulmy/gql-query-builder/pull/5

State: closed
Merged: Yes


I also integrated lint-staged (runs only on changed files).

Note that I had to change the way variables work. Now only object format is supported in this case. I went this way as it's easier to type and doing this simplified the codebase a notch. I can try to match the old behavior, though.

Another gotcha is that when you import from Node env (i.e. CommonJS), you have to do something like this:

const query = require('gql-query-builder').default;

I'm not entirely sure how to fix that in a neat manner. I guess we could just expose an object (regular export) as that's same for different environments and avoids this interoperability problem.

Please give this a go.

**Original Pull Request:** https://github.com/atulmy/gql-query-builder/pull/5 **State:** closed **Merged:** Yes --- I also integrated lint-staged (runs only on changed files). Note that I had to change the way variables work. Now only object format is supported in this case. I went this way as it's easier to type and doing this simplified the codebase a notch. I can try to match the old behavior, though. Another gotcha is that when you import from Node env (i.e. CommonJS), you have to do something like this: ```javascript const query = require('gql-query-builder').default; ``` I'm not entirely sure how to fix that in a neat manner. I guess we could just expose an object (regular `export`) as that's same for different environments and avoids this interoperability problem. Please give this a go.
kerem 2026-03-03 00:03:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gql-query-builder#62
No description provided.