[PR #6] [MERGED] Generalize API #142

Closed
opened 2026-03-15 11:37:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/atulmy/gql-query-builder/pull/6
Author: @bebraw
Created: 3/14/2019
Status: Merged
Merged: 3/14/2019
Merged by: @atulmy

Base: masterHead: feat-generalize


📝 Commits (7)

  • cf51ae9 refactor: Separate API into mutation/query
  • d29719b feat: Add queries/mutations generators
  • 01a0e63 docs: Update readme
  • 6adac9b refactor: Shrink API to query/mutation
  • 0270a04 fix: Fix "main"
  • 4123c87 fix: Drop empty commit from pre-version
  • fc8c219 refactor: Simplify Jest setup

📊 Changes

5 files changed (+211 additions, -108 deletions)

View changed files

📝 README.md (+29 -45)
jest.config.js (+0 -28)
📝 package.json (+7 -3)
📝 src/index.test.ts (+75 -15)
📝 src/index.ts (+100 -17)

📄 Description

I encoded operation type to the method name (i.e. query/mutation) and generalized the implementation to support queries and mutations. I added these methods to avoid ambiguity in typing.

If you prefer query([<options>]) kind of approach, that's feasible too. I suppose we would drop the two new methods then and fold them into this scheme.

Let me know what you think. Internally it's flexible so it's not a big deal to change the external API.

Closes #4.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/atulmy/gql-query-builder/pull/6 **Author:** [@bebraw](https://github.com/bebraw) **Created:** 3/14/2019 **Status:** ✅ Merged **Merged:** 3/14/2019 **Merged by:** [@atulmy](https://github.com/atulmy) **Base:** `master` ← **Head:** `feat-generalize` --- ### 📝 Commits (7) - [`cf51ae9`](https://github.com/atulmy/gql-query-builder/commit/cf51ae93dade4b7f636bf425a4085a29d63fde92) refactor: Separate API into mutation/query - [`d29719b`](https://github.com/atulmy/gql-query-builder/commit/d29719b017f644ed7822954b4691c3270aefc151) feat: Add queries/mutations generators - [`01a0e63`](https://github.com/atulmy/gql-query-builder/commit/01a0e637cd6291a0e2a80de75868c2592a3804f9) docs: Update readme - [`6adac9b`](https://github.com/atulmy/gql-query-builder/commit/6adac9bd4158354b977a9fae3fe98d2eb8801028) refactor: Shrink API to query/mutation - [`0270a04`](https://github.com/atulmy/gql-query-builder/commit/0270a04c6b94ee62ebf13a9d59b21225848a97df) fix: Fix "main" - [`4123c87`](https://github.com/atulmy/gql-query-builder/commit/4123c8704f0c022dc6b2d8d34d4d05cd804d8257) fix: Drop empty commit from pre-version - [`fc8c219`](https://github.com/atulmy/gql-query-builder/commit/fc8c21991aadc20c1980e0fa5ef9364db4c66d4f) refactor: Simplify Jest setup ### 📊 Changes **5 files changed** (+211 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+29 -45) ➖ `jest.config.js` (+0 -28) 📝 `package.json` (+7 -3) 📝 `src/index.test.ts` (+75 -15) 📝 `src/index.ts` (+100 -17) </details> ### 📄 Description I encoded operation type to the method name (i.e. `query`/`mutation`) and generalized the implementation to support `queries` and `mutations`. I added these methods to avoid ambiguity in typing. If you prefer `query([<options>])` kind of approach, that's feasible too. I suppose we would drop the two new methods then and fold them into this scheme. Let me know what you think. Internally it's flexible so it's not a big deal to change the external API. Closes #4. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:37:58 +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#142
No description provided.