Category "apollo-server"

Nestjs GraphQL subscriptions onConnect & onDisconnect callbacks

Is there an approach to hook into the onConnect and onDisconnect lifecycle-events in Nestjs?

How to pass multiple headers in Apollo GraphQI?

I wanted to know how to pass multiple headers in Apollo GraphQl as i know how to pass single but not multiple headers.Any solutions or suggestions appreciated.T

RESTDataSource - How to know if response comes from get request or cache

I need to get some data from a REST API in my GraphQL API. For that I'm extending RESTDataSource from apollo-datasource-rest. From what I understood, RESTDataSo

Return ENUM - Cannot return null for non-nullable field

I am using apollo-server-lambda, Prisma ORM and graphql-codegen. I have a query (getBookById) that returns a Book. Book contains an enum called BookStatus. I wa

Can't get redis cache to work with apollo server express

I'm trying to setup a caching system for my apollo express server, but it seems like the guides I've followed from the official docs: https://www.apollographql.

Resolve Same Entity in Different Services

I have use-case where same entity type needs to resolved in multiple service, for example Service A has type Post type Post{ id: ID! title: String } Ser

createReadStream is not present in uploaded image

I am using node v14.17.0,"apollo-server-express": "^2.25.0", "graphql-upload": "^12.0.0" I am trying to upload an image but i dont get createReadStream from the

res.session undefined graphql apollo-server-express

I am having trouble with sessions. For some reason, the req.session is undefined even though I'm using the session middleware. I was trying to use redis but I c

How can I get my User entity in UserApi to get connectin to db?

I have an apollo-express-server with redis cache. This is the index.ts: const main = async () => { const app = express(); app.use( cors({ cre

Union type result in graphql subscription

Is it possible to have a union result on a graphql subscription, specifically in AppSync? I tried the following in AppSync but got an error "The subscription h

Apollo GraphQL - Import .graphql schema as typeDefs

With graphql-yoga you can simply import your schema by doing the following: typeDefs: './src/schema.graphql'. Is there a similar way of doing so with apollo-ser

How do I solve this Apollo Control Cache error?

I am trying to set up my server side backend and I'm hitting this error: node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent prope

using req.headers.authorization gives Network error unable to reach server We could not introspect your endpoint graphQL Context failed: invalid token

I get the token from the login mutation and put it in the headers, but graphql server gives an error when trying to fetch that token using: const auth = req.he

How to use 'Decimal' as a field type in GraphQL schema?

I want to use Decimal as a type for latitude & longitude field in my GraphGL schema. But GraphQL provides only Float and Int. Is there is any package to sol

Web socket problem when adding subscriptions in URQL client

I am using URQL Client with Apollo server, now I am trying to handle subscriptions on URQL client, but I can't seem to make the web socket work. Hope someone ca

How to watch file changes with ts and js build

I have a project with fastify, apollo server fastify and nx. I want to add a script to build my code and run the js files. the problem is that if I make any cha

What does GraphQL do with the return value from a resolver?

I recently started learning GraphQL and I've discovered a situation that I'm unable to explain. Take the following example var {ApolloServer, gql} = require("ap

Multiple endpoints Graphql

Im working on a project that displays a list of .xml and .txt files on a web browser. Using a MERN Graphql stack, is it possible to have two different endpoints

Need Solution to integrate Node+Express+GraphQL+ApolloServer+ElasticSearch

I need to develop my backed application in NodeJS ExpressJS and GraphQL, and I am using the Apollo GraphQL server for this. Now I have to connect this GraphQL t