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
0 answers

graphql-file upload (POST body missing, invalid Content-Type, or JSON object has no keys.)

I'm currently working on implementing file uploads in GraphQL, but I'm encountering an issue. Whenever I try to upload a file, I receive the following error message: "POST body missing, invalid Content-Type, or JSON object has no keys." Here's an…
0
votes
1 answer

how to interact and fetch data from elasticsearch to graphql APOLLO 4

so here's my code, i'm really stuck my friends, i have no idea how to send data from my database to graphql, even when i try to do a POST request i receive NULL! here's my code divided in 5 files. server.js, the connection seems to work correctly, i…
0
votes
2 answers

graphql-http Missing query

Followed steps by steps just trying to integrate graphql from provided documentation of expressjs, https://github.com/graphql/graphql-http#with-express import express from 'express'; // yarn add express import { createHandler } from…
Faivsq
  • 3
  • 2
0
votes
0 answers

Graphql send the query to db for all columns or selected column provided by the frontend

Graphql has the ability that it returns only these column which is requested by the front end. But I have a question,Graphql send the query to db for all columns or selected column provided by the frontend. eg. I have a table let's say Users and it…
Mudasser
  • 11
  • 4
0
votes
1 answer

I am looking to find a way to a test graphql server with graphql-request library

I am using graphql-tag and supertest-graphql to test my apollo-server-express app. The following is my current approach. it('Query a quote', async () => { const id = '123456'; const res = await request(app) .query( gql` …
Nimo shr
  • 23
  • 4
0
votes
0 answers

loadFilesSync in resolvers returns a string of the code of my resolvers instead of resolvers Array

I am learning about graphQL and trying to use modules for my resolvers. This is my orders.model.js file: const orders = [ { date: '2005-05-05', subtotal: 90.22, items: [ { product: { …
Ric
  • 179
  • 1
  • 3
  • 16
0
votes
1 answer

Running method on every call using express-graphql

I'm using express-graqphl and was wondering if there is any concept of running a function before each graphql endpoint is executed? I'd like to have this for things like validating JWTs and other things. I realize we could use express for this,…
d512
  • 32,267
  • 28
  • 81
  • 107
0
votes
0 answers

Is GraphQL with codegen support wildcard operation?

I'm using graphql-codegen to generate typescript type from graphql schema. I'm trying to perform wildcard operation. query User($query: USERQueryInput){ user(query: $query){ _id name age address } } I want to…
0
votes
1 answer

How to structure nested lists of objects in GraphQL typeDefs

I have a type user which will contain an array of associated objects which are also a type which is defined. I am trying to figure out the best way to handle input types when creating objects like this with nested object types, I had defined the…
0
votes
0 answers

Return the wrong response if type of is number in the graphql

I tried to run the basic query in the graphql. But the below query is always return the no data if the typeof id is number. incase typeof id is string it returns the correct respone. { movie(id: 1) { id name } } respone { "data": { …
Gmv
  • 2,008
  • 6
  • 29
  • 46
0
votes
1 answer

(Graphql) The resolver value isn't of type object

I'm trying to use anilist public api while trying to set a backend using express and apollo, but I'm getting an error when I try to do a query using the ID of an anime to get some of its details. Any ideas on how to solve this? OBS: I got the…
0
votes
0 answers

Missing createReadStream as a argument from passed file

Im trying to upload file from react application , there are 3arguments: filename, mimetype and encoding . After the file is uploaded all three are passed to the server but there is no parameter createReadStream. $ node -v v16.13.2 I've tried so far…
0
votes
0 answers

req.headers.authorization coming back as undefined

I'm pretty new to graphql and apollo, and I'm working on a project where I need to be able to use context to get a variable for my query. The issue that I'm having is that my context.user is coming back null because my req.headers.authorization is …
pelotador.1
  • 195
  • 1
  • 12
0
votes
0 answers

How to filter by 'companyName'

In the below GraphQL query, how to get employees by 'companyName'. Please help. https://ms-gateway-f4b4o225iq-ue.a.run.app/graphql query FetchEmployeesQuery( $where: String $limit: Int $offset: Int $sort: [String!] ) { employees( …
0
votes
0 answers

Cannot read properties of undefined (reading `fieldname`) GraphQL

i am working on a project based on GraphQL API with nodejs And mongoose so i have this Model Below : const mongoose = require('mongoose') const BreakingNewsSchema = new mongoose.Schema({ MainInfo:{ content:{type:String,required:true}, …
elie mardelly
  • 79
  • 2
  • 10