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

Can't figure out proper configuration for Next.js, uploads and subscriptions with Apollo/GraphQL-Yoga

Pardon my newbie question here but I'm having a ton of difficulty getting this to work corrrectly. I'm having a hard time getting subscriptions to behave properly with Next.js, Apollo and GraphQL-Yoga. I've tried searching everywhere for answers and…
1
vote
0 answers

GraphQLError {message: "Syntax Error: Expected Name, found Int "30807695"",

I'm using crypto-js to hash data and send it by apollo-angular to express-graphql. I tried to send it as string using method toString() which fails 90 out of 100 even with async,await returning empty string. Then split object into two variables one…
1
vote
0 answers

How can I get a status code of a response in graphql-yoga?

I use graphql-yoga for my graphql server and I want to extract a status code under formatResponse: Query: { get_foo: () => { return fetch(URL).then(res => res.json()); }, const options = { ... // A function applied to each…
A. Karnaval
  • 727
  • 2
  • 8
  • 12
1
vote
0 answers

How to access the context in GraphQL from your resolvers

I just want to send the request to all my resolvers through the context field, but when I access it from one of my resolvers, it returns null. app.use('/graphql', graphqlHTTP(async (request, response, graphQLParams) => ({ schema: schema, …
ZoicanDenis
  • 21
  • 1
  • 7
1
vote
1 answer

GraphQL & Pulling Data from Oracle DB: Query Responds with the Resultset and Doesn't Come to The Graphql resolver Window

I am new to GraphQL. Started developing an GraphQL app to pull the data from oracle database. It is very simple application. The query responds with the resultset and can be seen results in console.log; however, it doesn't come to the graphql…
1
vote
0 answers

must have a selection of subfields. Did you mean \"createEvent { ... }\"?", [graphql]

I am learning graphql so please have patience with me. My app.js looks like this: const express = require('express'); const bodyParser = require('body-parser'); const graphqlHttp = require('express-graphql'); const { buildSchema } =…
Pinoy2015
  • 1,429
  • 15
  • 29
1
vote
1 answer

delete mutation returns null

I have a list of to-dos where I've successfully managed to add new items and update cache and now working on adding a delete mutation. My ultimate goal is to return an id from the delete mutation that this id could be used to update the whole list…
holler
  • 275
  • 3
  • 15
1
vote
0 answers

What are the best practices regarding GraphQL architecture using Apollo for an existing REST API?

I am new to GraphQL and want to integrate it to my REST API using Apollo server. I am wondering how to apply best practices to setup everything. Here is the scenario: I have an existing REST API with session cookie authentication via Redis. For now,…
samteb
  • 63
  • 9
1
vote
1 answer

Write dynamic schema for return same result in Graphql

Currently this schema working properly and give required result type Personal{ userId:String name: String email: String } type Contact{ mobile_no:String email:String } type Address{ address:String lat:String …
Ashok
  • 2,846
  • 1
  • 12
  • 20
1
vote
1 answer

Write resolvers for nested type definitions

Suppose I have following type definition for my GraphQL API: const typeDef = ` type Book { title: String author: Author likes: Int } type Author { id: String name: String age: Int …
1
vote
1 answer

getDirectives error when printing remote schema with graphql-tools

I have two node servers both serving graphql via express-graphql. I wish to have my first server stitch its schema with that of the second server. I have followed these instructions at:…
schwarz
  • 193
  • 2
  • 11
1
vote
0 answers

Passing Keycloak Access Token to NextJS?

NextJS is a hybrid app and I have created a custom express router that uses keycloak middleware. I'm trying to pass the bearer token of the userid and pass this token to Hasura so I can lockdown some graphql API, but I don't know how to handle…
TheBetterJORT
  • 808
  • 9
  • 22
1
vote
0 answers

GraphQL Error: "Expected Iterable, but did not find one for field Query" when fetching data from CryptoCompare API

I'm using GraphQL/express/express-graphql/axios to retrieve specific coin data from the CryptoCompare API. I have two endpoints: 1) https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC,ETH,LTC,BCH,NEO,ETC,XMR&tsyms=USD From endpoint 1, I…
user10013590
1
vote
1 answer

self._expandAttributes is not a function

ppvPlanDb.models.ppv_plans.findAll({ attributes: ['id', 'studio_id', 'status', 'is_advance_purchase','content_types_id' ], where: sequelize.and(sequelize.where(sequelize.col('ppv_plans.status'), '=',…
Upasana
  • 45
  • 9
1
vote
1 answer

How to access the value of parent resolver inside a field resolver while using buildSchema?

When we are using graphqlHTTP, the first argument passed to the resolve method is actually the parameters passed by the client query not root this is fine for a query resolver. But for a usecase where field resolver needs to know of a value of the…
Pavan Bahuguni
  • 1,947
  • 1
  • 15
  • 21