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
1
vote
4 answers

GraphQL Subscriptions using Express-GraphQL

Can anyone tell me how to implement GraphQL Subscriptions using Express-GraphQL in Node?
1
vote
1 answer

express + express-graphql helloworld returns null

I am new to graphql and trying to implement a simple helloworld solution which when queried is returning null. The setup includes sequelize and pg and pg-hstore which I have however disabled to try and figure out where the problem is. Thanks in…
1
vote
1 answer

MongoDB, Express + GraphQL server: Updated data model with new fields, but queries do not pick up new fields

I created a GraphQL server in combination with Express + MongoDB. I started with the following data model: const AuthorSchema = new Schema({ name: { type: String, required: true }, age: { type: Number, required: true }, }); Queries + Mutations…
1
vote
1 answer

Graphql response not coming from Apollo client query

in my local http://localhost:3000/graphql query is working like below... but when I am querying through apollo client its response coming empty import {InMemoryCache, gql, ApolloClient, HttpLink} from 'apollo-boost'; const cache = new…
Rituraj ratan
  • 10,260
  • 8
  • 34
  • 55
1
vote
1 answer

What to use for graphql with nodejs

I started looking into graphql to use it as a server in the next project instead of REST. As I started I was bombarded with lots of options. graphql-yoga, express-graphql, apollo and so on I want to know which one is the most widely used option and…
1
vote
1 answer

Deployed my app on heroku but got error: Failed to load resource: net::ERR_CONNECTION_REFUSED

My app's front-end is Reactjs and backend is Node js. I used express server and graphql-express server. I deployed my app successfully. But it starts with data is loading and then nothing shows. But if I run locally npm start then the heroku app is…
Krisna
  • 2,854
  • 2
  • 24
  • 66
1
vote
1 answer

importSchema GraphQL Error: ENOENT: no such file or directory, open './schema.graphql'

I try to import graphql schema with the following code: import { importSchema } from 'graphql-import' const typeDefs = importSchema(`./typeDefs/schema.graphql`) I got an error: fs.js:114 throw err; ^ Error: ENOENT: no such file or…
Roman
  • 19,236
  • 15
  • 93
  • 97
1
vote
1 answer

GraphQL mutation "Cannot set headers after they are sent to the client"

I'm implementing graphql login mutation to authenticate user login credential. Mutation verifies the password with bcrypt then sends a cookie to the client, which will render user profile based on whether the cookie is a buyer or owner user).…
jche
  • 129
  • 2
  • 16
1
vote
1 answer

Send GraphQLUpload to imagekit.io from node server running express-graphql

Inexperienced dev here. This issue is driving me crazy. I am sending an image file from a react front end via a graphQL mutation to a node server running express-graphql. The uploadFile mutation works correctly, and I am able to save the file…
Will
  • 11
  • 1
1
vote
0 answers

How to connect a multi page web app to graphql?

I have a backend graphql server in express, node. I have a react Single Page Application(SPA) admin web app that communicates to graphql via Apollo. I need a a Multi Page Application (MPA) Content Management Site (CMS) for general internet user to…
Kucl Stha
  • 565
  • 1
  • 6
  • 20
1
vote
2 answers

Attach a property in context(request in express.js) object

I'm new to GraphQL, and I'm now trying to make an API server with express-graphql. What I want to do is add new property in context object for resolvers, which can be done when I initialize the express-graphql server instance. According to the…
cadenzah
  • 928
  • 3
  • 10
  • 23
1
vote
1 answer

Apollo Server v2 - GraphQL resolver not being invoked

I am a newbie to the graphql world and I'm trying to setup multiple modular schemas and resolvers using Apollo Server v2. I noticed a weird behavior where I have issues with the order of my resolvers. In the line Object.assign({},…
socket_var
  • 1,063
  • 2
  • 11
  • 18
1
vote
1 answer

GraphQL fetch data at Query level results in redundant/useless request

We are implementing GraphQL service, which stands in front of several backend microservices. For example, we have a Product and each product has a list of history orders. Our backend server provides two REST APIs, one for product detail data, the…
Jess
  • 620
  • 1
  • 7
  • 18
1
vote
0 answers

Firebase authentication with SSR apollo react app

I have a SSR react app that uses apollo. My app server lives under one domain using express while the graphql server is under another domain. I'm having issues trying to understand how the authentication should work. Currently on my app server I…
Dan Ramos
  • 1,092
  • 2
  • 19
  • 35
1
vote
1 answer

How to use apollo-datasource-rest without Apollo Server but with express-graphql

I'm in the process of making a graphql server that sits between our old rest api. There will be db connectivity, but in most cases the data in the graphql server will be coming from http calls to those rest api endpoints. So far it has been possible…
Dac0d3r
  • 2,176
  • 6
  • 40
  • 76