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

How to change or extend express-graphql context without recreating the request handler?

howto change/extend express-graphql context without recreating the request handler ? /** */ const schema = makeExecutableSchema({ typeDefs, resolvers, }); /** */ export default (req: any, res: any, context: any) => { console.log("context:",…
Dan
  • 2,818
  • 23
  • 21
0
votes
2 answers

express + express-graphql app crashes, unexpected token pretty = optionsData.pretty ?? false;

I'm trying to get an express-graphql app up and running and I've been following the example code from the official documentation. However it keeps crashing and I'm getting this error in my terminal after running npm…
0
votes
1 answer

Why "first" is undefined argument in GraphQL?

I am trying to retrieve only 5 first records from my query and I saw that there was the keyword "first" to do that onGraphQL. I tried and it says undefined argument. Since it is a GraphQL keyword why it does not recognize it? I am using Ruby on…
0
votes
0 answers

How to validate graqhql input type field?

I have the following input object type that I want to validate its field by set required. e.g: I want to set name and phone1 property as required. I would like to know is there is any way that we can do it. I have searched on the internet so far…
Pen Lymeng
  • 271
  • 5
  • 14
0
votes
1 answer

ExpressGraphql JWT authentication, not working

For the past 2 weeks, I'm working on this solution but no success. Can anyone suggest to me where I'm going wrong? For authentication, I'm using express-graphql, express-jwt for authentication [backend-[node, express-graphql, express-jwt,…
Tested
  • 761
  • 4
  • 16
  • 38
0
votes
1 answer

Graphql Api Chuck Norris

I need help building a GraphQL Api that wraps the ChuckNorris.io API The API sholud have aQuery type that resolves all Categories (https://api.chuckmorris.io/jokes/categories) The Api should have Query type that resolves a random joke given as an…
0
votes
1 answer

Returning an array of Strings with node and graphql

I am using node and graphql to get value (array of string) of a specific key. Following is the schema which is being used var schema = buildSchema(` type Query { keyValue(id: String!): KeyValue }, type KeyValue { value:…
Mandeep Singh
  • 1,287
  • 14
  • 34
0
votes
1 answer

Best way for splitting GraphQL schema into different modules in express-graphql?

I'm new to QraphQL and I found some best practices for module system in apollo-server but I can't find anything for express-graphql! I'm using GraphQLSchema instead of buildSchema. and when I'm trying to split my code into different modules, it will…
0
votes
1 answer

Share enum in Graphql

Just started learning GraphQL and I would like to share an enum that I exported in a express apollo server. ./src/shared/fruitsEnum.ts export enum fruitsEnum{ APPLE, ORANGE } Import the enum ./src/market/fruits.ts import { fruitsEnum }…
calvert
  • 631
  • 10
  • 33
0
votes
0 answers

user is not defined Express-GraphQl Error

Here is my graphql query: query { login(email:"please@work.com", password:"testing321"){ token } } Here is the response: { "errors": [ { "message": "user is not defined", "locations": [ { "line": 2, …
Alan Karanja
  • 51
  • 1
  • 3
0
votes
0 answers

is it possible to handle Apollo client / express / mongoose / graphql errors in React?

React is showing the regular developer errors even in the built and I want to handle at least some with errorboundray or similar, the actual customized errors are thrown by mongoose in my apollo client / express server / graphql implementation,…
Lester Arévalo
  • 342
  • 1
  • 6
  • 12
0
votes
1 answer

Apollo server 2.0 not working with join-monster-graphql-tools-adapter and oracle

I am building a graphql server on expressjs. Below is the code: const express = require('express'); const app = express(); const {ApolloServer} = require('apollo-server-express'); const server = new…
0
votes
1 answer

Express cookie parser is not creating cookies in production

I am using graphql-yoga and I am writing cookies that access the Microsoft Graph API. On the front end I have an apollo client with NextJS set up and it is working perfectly... in development. When I deploy the server there is no recognition of the…
Jordan Rhea
  • 1,186
  • 15
  • 34
0
votes
1 answer

Cannot query field signup on type Query

Started messing around with GraphQL, but I'm stuck with this error. Not sure if it's a problem in the schema definition or in the query. const express_graphql = require('express-graphql') const { buildSchema } = require('graphql') const users =…
AFMeirelles
  • 409
  • 3
  • 8
  • 25
0
votes
1 answer

creating graphql schema for a response from an API that has an array of objects

I am getting a response from an Api that looks like this: property: Array(100) 0: {identifier: {…}, address: {…}, location: {…}, vintage: {…}} 1: {identifier: {…}, address: {…}, location: {…}, vintage: {…}} 2: {identifier: {…}, address: {…},…