[GH-ISSUE #58] Question: nested variables as object #131

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

Originally created by @psyCodelist on GitHub (Jun 1, 2021).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/58

Hi, thank you all for the wonderful library,

I have to create a quey as follow:

   "query":"mutation($params:StoreCreateRequest!){
      createStore(params: $params){
       name
      }
   }",
   "variables":{
       "params":{
           "organization_id":"abc-def",
           "name":"my-store",
           "type":"Kafka",
           "uris":["http://ds.io"],
           "availability_zone":"a",
           "secret":{"value":[ { key: "a", value: "b" }] },
           "metadata":{"value":[ { key: "c", value: "d" } ]}
       }
    }


Is it possible to generate it with gql-query-builder?

Many thanks in advance!
Originally created by @psyCodelist on GitHub (Jun 1, 2021). Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/58 Hi, thank you all for the wonderful library, I have to create a quey as follow: ```{ "query":"mutation($params:StoreCreateRequest!){ createStore(params: $params){ name } }", "variables":{ "params":{ "organization_id":"abc-def", "name":"my-store", "type":"Kafka", "uris":["http://ds.io"], "availability_zone":"a", "secret":{"value":[ { key: "a", value: "b" }] }, "metadata":{"value":[ { key: "c", value: "d" } ]} } } Is it possible to generate it with gql-query-builder? Many thanks in advance!
kerem closed this issue 2026-03-15 11:35:09 +03:00
Author
Owner

@DnOberon commented on GitHub (Sep 21, 2021):

@psyCodelist I don't think so - I'm trying something similar and this library keeps freaking out on nested variables

<!-- gh-comment-id:923506260 --> @DnOberon commented on GitHub (Sep 21, 2021): @psyCodelist I don't think so - I'm trying something similar and this library keeps freaking out on nested variables
Author
Owner

@aacassandra commented on GitHub (Feb 17, 2022):

Hi, thank you all for the wonderful library,

I have to create a quey as follow:

   "query":"mutation($params:StoreCreateRequest!){
      createStore(params: $params){
       name
      }
   }",
   "variables":{
       "params":{
           "organization_id":"abc-def",
           "name":"my-store",
           "type":"Kafka",
           "uris":["http://ds.io"],
           "availability_zone":"a",
           "secret":{"value":[ { key: "a", value: "b" }] },
           "metadata":{"value":[ { key: "c", value: "d" } ]}
       }
    }


Is it possible to generate it with gql-query-builder?

Many thanks in advance!

@psyCodelist yes you can, try this

"variables": {
    "params": {
        "value": {
             "organization_id":"abc-def",
             "name":"my-store",
             "type":"Kafka",
             "uris":["http://ds.io"],
             "availability_zone":"a",
             "secret":{"value":[ { key: "a", value: "b" }] },
             "metadata":{"value":[ { key: "c", value: "d" } ]}
        },
        "required": true,
        "type": "StoreCreateRequest"
    }
}
<!-- gh-comment-id:1042500781 --> @aacassandra commented on GitHub (Feb 17, 2022): > Hi, thank you all for the wonderful library, > > I have to create a quey as follow: > > ``` > "query":"mutation($params:StoreCreateRequest!){ > createStore(params: $params){ > name > } > }", > "variables":{ > "params":{ > "organization_id":"abc-def", > "name":"my-store", > "type":"Kafka", > "uris":["http://ds.io"], > "availability_zone":"a", > "secret":{"value":[ { key: "a", value: "b" }] }, > "metadata":{"value":[ { key: "c", value: "d" } ]} > } > } > > > Is it possible to generate it with gql-query-builder? > > Many thanks in advance! > ``` @psyCodelist yes you can, try this ``` "variables": { "params": { "value": { "organization_id":"abc-def", "name":"my-store", "type":"Kafka", "uris":["http://ds.io"], "availability_zone":"a", "secret":{"value":[ { key: "a", value: "b" }] }, "metadata":{"value":[ { key: "c", value: "d" } ]} }, "required": true, "type": "StoreCreateRequest" } } ```
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#131
No description provided.