Tag: Node.Js
-
Why does async code mess up my dataloader in a graphql resolver?
0 I have a dataloader that I’m using to batch requests to a service to get my user’s addresses. The loader doesn’t batch requests correctly when the parent resolver uses async code. Here’s a general idea of what my code looks like: // User.ts import Demographic from ‘./Demographic’ export type User { name: ‘User’, description:…
-
can’t set members array in mongodb with prisma
0 I use Prisma, apollo-graphql, and Mongoose to create chat applications but I have this problem, MongoDB gets only _id when I try to create a chat. Prisma Schema: generator client { provider = "prisma-client-js" } datasource db { provider = "mongodb" url = env("DATABASE_URL") } model User { id String @id @default(auto()) @map("_id") @db.ObjectId…
-
How to watch ts,js,graphql extensions in ts-node-dev?
0 I am trying to run the node server by ts-node-dev and restart on any any changes in specific files. It is restarting on any changes made to ts,js files however, it is not restarting on changes to graphql files. Any suggestions? "scripts": { "start": "tsnd –transpile-only –rs ./src/microservices/index.ts –watch–extionsions ts,js,graphql" } node.js graphql ts-node…
-
How to correctly use the IN filter with graphql?
0 I’m trying to fetch multiple transactions with an array of IDs but i might do something wrong and i’m facing the following error : ERROR GraphQL Error: [ { path: null, locations: [ [Object] ], message: "Validation error of type WrongType: argument ‘filter.id’ with value ‘ObjectValue{objectFields=[ObjectField{name=’id’, value=ObjectValue{objectFields=[ObjectField{name=’in’, value=VariableReference{name=’ids’}}]}}]}’ contains a field not in ‘ModelIDInput’:…
-
How to represent a map or object with key-value pairs in GraphQL?
2 How can I query for the following object? { result: { ‘1’: { ^^^ these are dynamic keys, never constant id: ‘id1′, }, ’20’: { id: ‘id2’, }, ‘300’: { id: ‘id3′, }, } } I know that I can define the result object fairly simply, if it wasn’t a key-value pair object. const…
-
NGINX NextJS GraphQL same origin same port fetch calls show 502 Bad Gateway Error
0 Alright I’ve been completely stuck on this and need huge help quick. What I’m trying to do: My domain: https://example.com (just a placeholder) NextJS App https://localhost:3000 (custom server with express) My GraphQL API https://localhost:3000/api/graphql (custom server with express) The NextJS App and the GraphQL API is on the same NodeJS server. The routes actually…
-
apollo-server-express CORS issue
25 So I am migrating to apollo-server-express 2.3.3 ( I was using 1.3.6 ) I’ve followed several guides, making the necessary tweaks but am stuck in a CORS issue. According to the docs you have to use the applyMiddleware function to wire up the apollo server with express. I am currently doing the following: const…
-
Must a GraphQL field be a Query type to be mentioned in a query?
1 Say I have this GraphQL query: query GetUser($user_id: Int) { user(user_id: $user_id) { name } groups(user_id $user_id) { name } } This query recieves user id, and returns: user’s name names of all the groups this user belongs to I know that user should be defined in the SDL like this: type Query{ user(user_id:…
-
Artillery Performance Testing for Graph ql endpoints in yml file (not able to see debug log or what went wrong after execution)
0 I am using artillery node JS based tool for performance testing with yml based scenario. I have installed all the plugin library I am able to run artillery test But I am not able to see logs for what is wrong in my graph ql request and what is response. I tried to set…
-
Lead Platform Engineer- 100% Remote- 12+months – Khayainfotech – Remote
Khayainfotech Remote $80 – $90 Contract: Independent, W2, 12 Month(s) Skills GraphQL Agile Node.js Javascript Job Description Hi, Job Title: Lead Platform Engineer Project Duration : 12 months Work Location:100% Remote Description: As a Sr.Lead Platform Engineer, Platform Engineering – Digital APIs you will be responsible for the technical and architectural mentorship for Client’s…