Questions tagged [express-graphql]

GraphQL HTTP Server Middleware

Create a GraphQL HTTP server with any HTTP web framework that supports connect styled middleware, including Connect itself, Express and Restify.

386 questions
0
votes
1 answer

GraphQL - Query Seems Fine but Getting 400 Error

So, whenever I try to add a product to the inventory list, via a mutation, I get a POST http://localhost:3000/graphql 400 (Bad Request). I can perform the mutation in the sandbox without issue. And, the query to retrieve information works just fine.…
MatthewS
  • 455
  • 2
  • 7
  • 22
0
votes
0 answers

sequelize not returning a graphql type

I am following multiple tutorials on the internet and most of them use this implementation where the resolver query method returns a promise where its return type is a graphql typescript generated type. The sequelize returns a different type which…
0
votes
1 answer

Graphql keeps returning null in graphql and express

I'm trying to query data in GraphQL and express. I wrote the schema and the resolvers, but no matter what I do, it keeps returning null. I tried to re-write everything, I tried to use apollo-express, I looked everywhere but no matter what I tried it…
0
votes
1 answer

Custom GraphQL Error types for Validation

Is this possible to set custom GraphQL Error types for at least BAD_USER_INPUT code? On the backend I've got an error type something like this: throw { type: 'ValidationError', code: 422, success: false, message: `Something didn't…
user16373392
0
votes
2 answers

express-session crashes server on setting cookie?

Basically this other post Express-session does not set cookie? where I'm following Ben Awad's Fullstack Tutorial. The cookie gets created but the server crashes and this is the error node:internal/errors:464 ErrorCaptureStackTrace(err); ^ TypeError…
0
votes
0 answers

Restore request data after parsing multipart/form-data

I'm trying to implement a middleware that's able to read the content of the data sent on the request as multipart/data-form and later restore it back so express-graphql and graphql-upload can understand the request. Since I need to read the content…
fingerprints
  • 2,751
  • 1
  • 25
  • 45
0
votes
0 answers

GraphQL How to read values with dealy using UseSubscription hook

I have created a graphQL Realtime server and client reading values using useSubscription hook. Can anyone tell me please how to create a delay of few seconds to read the values. Right now on the server side, I have created a change stream on a…
ATHER
  • 3,254
  • 5
  • 40
  • 63
0
votes
0 answers

Handling a nullable relationship in a nested resolver in graphql

I am building a graphql api with Express and express-graphql. I have eaUsers that may belong to a trainingLocation, but they may not. type EaUser { id: ID! email: String! firstName: String! lastName: String! …
llhilton
  • 170
  • 5
  • 15
0
votes
1 answer

Nestjs define GraphQL Object type got this error: Schema must contain uniquely named types but contains multiple types named "Address"

I use Nestjs & GraphQL for backend development, when I define model class (code first), I got following error: Schema must contain uniquely named types but contains multiple types named "Address". Following is my Reader model…
Michael
  • 27
  • 5
0
votes
2 answers

GraphQL Explorer not working with Express Sessions

I'm trying to create a login system with GraphQL and Express, but the sessions aren't being saved. Whenever I log in, req.session.userId stays undefined. My code: (async () => { await connect(process.env.MONGO_URI!, { dbName: "example" }); …
mathletedev
  • 182
  • 1
  • 9
0
votes
2 answers

How can I share data between 2 resolver functions in Express GraphQL?

I have 2 queries, and corresponding functions, but while writing the resolver, I'm not sure how to store the 1st func data, then reuse it in the second one. Note: I do not want to call the function again as it will be executing again and has an…
Min Yoongi
  • 396
  • 5
  • 16
0
votes
0 answers

How to group nested data in GraphQL

{ "data": { "books": [ { "name": "Himu", "genre": "novel", "author": { "name": "Humayun Ahmed", "country": "Bangladesh" } }, { "name": "Tatina", "genre":…
soykot2910
  • 101
  • 1
  • 8
0
votes
0 answers

Not accessible to Docker MySQL container from Node.js Express-GraphQL server container

After successfully running both locally on the localhost, I tried to dockerize and run them for dev environment using nodemon. docker-compose up Both container seems to get launched but get failed connection for some reason. How can I solve the…
0
votes
1 answer

typeDefs must contain only strings, documents, schemas, or functions, got object

I am working on an express apollo server and structured all the graphql types like below: I am using 'graphql-tools/load-files' and 'graphql-tools/merge' for merging all the types. My index.js file is like belwo: const path = require('path'); const…
0
votes
0 answers

If graphQL uses an async concept and has http capability why does it conflict with the REST API design of Node/Express with http?

I've set up a TypeScript/Node/Express API that includes 'http' for REST and 'express-graphql'. After coding the schema, resolvers and types for TypeScript conformity I run with nodemon ts-node and everything is fine with 'http' requests. When I send…
Brian Quinn
  • 57
  • 1
  • 4