0 I use https://github.com/shurcooL/graphql for graphql queries and I need to make the following mutation: mutation createPromotion($input: CreatePromotionInput) { createPromotion(input: $input) } with the following graphql variables: { "input": { "channel": "my_channel", "offerType": "my_offer_type", } } In my code it looks like this: type CreatePromotion struct { CreatePromotion graphql.String } func (g *Gate) CreatePromotion(ctx context.Context) […]
-1 in my golang project I use https://github.com/shurcooL/graphql for graphql queries and I need to make the following mutation: mutation createPromotion($input: CreatePromotionInput) { createPromotion(input: $input) } with the following graphql variables: { "input": { "channel": "my_channel", "offerType": "my_offer_type", } } In my code it looks like this: type CreatePromotion struct { CreatePromotion graphql.String } func […]
0 There are 2 tag fields in my content fragment model lets assume the names as tag1 and tag2. User creates a content fragment and selects the desired tag values. But I want to take these 2 values and combine them with an underscore. is there any command that permits this in graphql or is […]
0 I have a response from GraphQL which is similar to: "data": { "x": { "y":{ "nodes": [ { "id": 123 }, { "id": 123 }, { "id": 456 } ] } } } Is there a way to reduce this so that no duplicate IDs come, using the graphQL query. graphql Share Follow asked […]
0 I have an async function, in which I take some arguments. Based on what is passed as argument, I call another function. You can consider the structure to be something like this. async function createTaskReminder(val) { switch (val) { case 1: await call1(); case 2: await call2(); case 3: await call3(); } I call […]
5 I am trying to connect to my AWS AppSync API using the plain Apollo Client but I am not sure how to structure the authentication header correctly. So far I have followed the header authentication documentation here: https://www.apollographql.com/docs/react/recipes/authentication.html And have this code, which I adapted to include the token call to the Amplify authentication […]
10 The legacy std::for_each returns function as the standard only requires Function to meet Cpp17MoveConstructible according to [alg.foreach]: template<class InputIterator, class Function> constexpr Function for_each(InputIterator first, InputIterator last, Function f); Preconditions: Function meets the Cpp17MoveConstructible requirements. [Note: Function need not meet the requirements of Cpp17CopyConstructible. end note] This is reasonable since the user may want to […]
10 I know that you can use static_cast<void>, but it just seems too verbose for me, and not reflecting the original intent that I want to discard a return value, not to cast it to anything. Recently I stumbled upon std::ignore, which can accept a value of any type, the name is clear and readable, […]
0 Context: I want to create a GraphQL query template with different variables that I can replace with key/values from another dictionary I want to give JS/React this template and dictionary and be able to replace the variables in the template with the corresponding values in the dictionary How would you recommend I do this? […]