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
1 answer

apolloGateway cannot connect to graphql express service

I ran a service using apolloGateway: export const server = async () => { const app = express(); const services = [ { name: "product-service", url: "http://localhost:4001/graphql" }]; const availableServices: any[] = []; const gateway = new…
Furkan Gulsen
  • 1,384
  • 2
  • 12
  • 24
1
vote
0 answers

buildschema from graphql throws 'TypeError: nodes.flatMap is not a function'

Am using node version 10.24.0. But when I try the example from the official site. const graphql = require('graphql'); const schema = graphql.buildSchema(` type Query { hello: String }`); I get the following error. TypeError: nodes.flatMap…
1
vote
1 answer

Cannot return null for non-nullable field - Typegoose and TypeGraphQL

I have this Album model set up using Typegoose and TypeGraphQL, which contains multiple songs from the Song model using the AlbumSong ObjectType: import { prop as Property, getModelForClass, modelOptions, Ref, } from…
Bowis
  • 541
  • 8
  • 31
1
vote
1 answer

How to return a rejected Promise to Graphql?

I've got a login method that returns a Promise to GraphQL to resolve. If the user is found and authenticated it resolves the user and works as it should. However, if the account doesn't exist or couldn't be resolved, the promise is rejected with a…
aarona
  • 35,986
  • 41
  • 138
  • 186
1
vote
0 answers

Having trouble connecting apollo sql datasource with mssql; getting "Login failed for user "

I'm trying to send GraphQL queries to a mssql database utilizing the Apollo SQL datasource. I believe the error is in the configuration object, since it's recognizing that I'm trying to access the database. I tried looking through the knex…
1
vote
1 answer

Graphql response error. String cannot represent value of JSON

I have an error here at graphql. I'm trying get an airport name through JSON data. I need a single item which's (name of the airport) but I'm receiving array of items with it's city, country, geolocation and so on. Here's the code I'm trying…
Dany 46
  • 23
  • 6
1
vote
0 answers

3 level type object does not return expected results

i am working with apollo graphql and i have a query with 3 nested type objects. as shown below query{CyberStrategyMaturity{ maturityItemDisplay { items { org_id } } }} result_of_3_layer_query although the above does not result in…
1
vote
1 answer

GraphiQL mutation does not accept input type

Hi I am making a booking system following the tutorial series https://www.youtube.com/watch?v=MRrcUQhZwBc&list=PL55RiY5tL51rG1x02Yyj93iypUuHYXcB_&index=8 And I am following them(while changing names of fields to suit my database more) Here is my…
1
vote
1 answer

Unable to get graphql response from server that's running on local

I have a mongodb server setup which on running the below command starts on port 3000 npm run start I also a graphql server which on running the below command starts at port 4000 npm run start-graphql the scripts of my package.json is as…
Amaarockz
  • 4,348
  • 2
  • 9
  • 27
1
vote
1 answer

GraphQL use simple object instead create specific type on schema

im new in graphql, and what i want to achieve is simplify this schema: input UserQueryFilter { email: String } input UserQueryInput { filter: UserQueryFilter anotherArgs: String } type User { email: String! } Query { User…
FatihAziz
  • 438
  • 4
  • 11
1
vote
2 answers

Nest js throttler with GraphQL is not working as expected

@Injectable() export class GqlThrottlerGuard extends ThrottlerGuard { getRequestResponse(context: ExecutionContext) { const gqlCtx = GqlExecutionContext.create(context); const ctx = gqlCtx.getContext(); return { req: ctx.req, res:…
1
vote
1 answer

cant fetch graphql server

hi I followed a tutorial for GraphQL, that is the code I wrote until now : const express = require('express'); const {graphqlHTTP} = require('express-graphql'); const graphql = require('graphql') const { GraphQLSchema, …
1
vote
1 answer

express-graphql : context is always undefined

I have a simple implementation of graphQl on my api, but can't seem to get any other arguments than args from the resolvers. The code is pretty simple, so it shouldn't cause any issue : const bindGraphqlModule = (app) => { app.use( …
Fed
  • 11
  • 2
1
vote
1 answer

Should or can I fetch data for a child resolver in the parent?

I'm just starting out with graphql so this may be a stupid question, but I have the following situation: I have an object, let's call it car, it has various properties, among them a log of drivers or whatever. When I query a specific car and I want…
Splatbang
  • 756
  • 1
  • 12
  • 29
1
vote
0 answers

Which executes first? Query or Mutation in graphql?

I'm new to graphql and just wanted to ask which operation executes completely first? Query or Mutation? I went through the docs and it mentions queries are in parallel, and mutations are serial, but if both are present, which one completes…
Min Yoongi
  • 396
  • 5
  • 16