Questions

  • GraphQL Dataloader on non-id fields?

    0 We’re using NodeJS (typescript) and GraphQL for our backend. Therefore we rely heavily on dataloaders, and we get more and more field resolvers that needs to be resolved on something other than IDs. An example is a field resolver on our User object, called "follows_me". In this case we need to make a lookup […]

  • Unhandled GraphQL subscription error, when using apollos subscribeToMore method in an angular chat component for subscription

    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 […]

  • Unable to resolve signature of property decorator when called as an expression

    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() […]

  • Why do I need to specify the type of a default constructed object in this situation?

    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>{} } // <= […]

  • AWS Amplify GraphQL API: Unable to retrieve the first 10 items (with `beginsWith` filter)

    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: […]

  • ApolloClient is not a constructor (apollo-client with nodejs)

    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 […]

  • Shopify Image Uploads failing using GraphQL API

    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 […]

  • Invariant Violation: When using graphql Mutation on nextjs 13

    0 all my query is working well, except for my graphql mutation. hope you can help. I’m using the same code on my other project, the only difference is this form is inside a modal. error on showing And I know this mutation on my playground is working graphql playground working mutation here’s my full […]

  • graphql variable types

    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) […]

  • golang graphql variable types

    -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 […]