5 Problem Description I have a chat component in angular that gets messages from the backend via a graphql query. On the same query, I subscribe to updates when a new message is added via a graphql mutation. The messages subscription is coded as a method of the chat component so that I can invoke […]
8 import { isEmail, isEmpty, isPhoneNumber, Length } from "class-validator" import { Field, InputType } from "type-graphql"; @InputType() export class RegisterInput { @Field() @Length(2, 15, { message: "Username Must Be At Least 2 characters" }) username?: string; @Field() @isEmail() email?: string; @Field() @Length(1, 20) @isPhoneNumber() phoneNumber?: string; @isEmpty() password?: string } The thing is @isEmail() […]
9 I don’t understand why in foobar below I need to specify std::vector<int>{} whereas in foobar2 I do not: #include <iostream> #include <memory> #include <vector> #include <tuple> std::tuple<std::unique_ptr<int>, std::vector<int>> foobar() { std::unique_ptr<int> test = std::make_unique<int>(42); return { std::move(test), {} }; // <= this is a syntax error // return { std::move(test), std::vector<int>{} } // <= […]
0 Here’s my schema: type Post @model { createdAt: AWSDateTime! hash: String! version: Int @default(value: "0") @index(name: "byVersion", sortKeyFields: ["createdAt"]) } Here’s the generated query that AWS Amplify generates: export const postsByVersionAndCreatedAt = /* GraphQL */ ` query postsByVersionAndCreatedAt( $version: Int! $createdAt: ModelStringKeyConditionInput $sortDirection: ModelSortDirection $filter: ModelPiecePostFilterInput $limit: Int $nextToken: String ) { postsByVersionAndCreatedAt( version: […]
9 I don’t have any UI framework. Just a simple Nodejs script where I need to query a GraphQL. Codes: const ApolloClient = require(‘apollo-client’) const client = new ApolloClient() Error message: TypeError: ApolloClient is not a constructor Package.json: { … “dependencies”: { “apollo-client”: “^2.4.13”, “graphql”: “^14.1.1”, “graphql-tag”: “^2.10.1” }, } Node: v8.9.4 I googled a […]
0 I’m rewriting a script to upload large batches of images to Shopify using the GraphQL API. I keep running into two issues, the first is images that upload successfully do not process properly. The second issue is I hit the rate limit and the script breaks out of the loop despite having exponential rate […]
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 […]