gql-query-builder icon indicating copy to clipboard operation
gql-query-builder copied to clipboard

Custom variable parameter

Open vikiival opened this issue 4 years ago • 2 comments

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 ?

vikiival avatar Feb 25 '22 13:02 vikiival

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

toadkicker avatar Jul 08 '22 17:07 toadkicker

I also need to know that

kingRayhan avatar Apr 07 '23 05:04 kingRayhan