[GH-ISSUE #65] Custom variable parameter #135

Open
opened 2026-03-15 11:35:56 +03:00 by kerem · 2 comments
Owner

Originally created by @vikiival on GitHub (Feb 25, 2022).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/65

Hey,
I found this library and is really nice and easy to use, however I found a case where I would need a help

I need to write query like

query ($owner: String!) {
  nftEntities(where: {currentOwner_eq: $owner}) {
    id
    metadata
  }
}

and so far my hack is

query({
  operation: 'nfts: nfts: nftEntities(where: {currentOwner_eq: "vikiival"})',
  fields: ['id', 'metadata']
})

The thing I need is to somehow wrap the variable into the object.
Question is: Is it possible to do that? Or should I just pass the whole object ({currentOwner_eq: "vikiival"}) as the variable ?

Originally created by @vikiival on GitHub (Feb 25, 2022). Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/65 Hey, I found this library and is really nice and easy to use, however I found a case where I would need a help I need to write query like ```graphql query ($owner: String!) { nftEntities(where: {currentOwner_eq: $owner}) { id metadata } } ``` and so far my hack is ```js query({ operation: 'nfts: nfts: nftEntities(where: {currentOwner_eq: "vikiival"})', fields: ['id', 'metadata'] }) ``` The thing I need is to somehow wrap the variable into the object. Question is: Is it possible to do that? Or should I just pass the whole object (`{currentOwner_eq: "vikiival"}`) as the variable ?
Author
Owner

@toadkicker commented on GitHub (Jul 8, 2022):

You would want a GQL resolver to handle this problem I think

<!-- gh-comment-id:1179195279 --> @toadkicker commented on GitHub (Jul 8, 2022): You would want a GQL resolver to handle this problem I think
Author
Owner

@kingRayhan commented on GitHub (Apr 7, 2023):

I also need to know that

<!-- gh-comment-id:1499948852 --> @kingRayhan commented on GitHub (Apr 7, 2023): I also need to know that
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#135
No description provided.