Questions tagged [apollo-server]

Apollo Server is a GraphQL server for Express, Connect, Hapi and Koa, written in TypeScript

Apollo Server is a community-maintained open-source server.

It works with all Node.js HTTP server frameworks: Express, Connect, Hapi and Koa.

Useful links:

2126 questions
0
votes
1 answer

How to use Data Loader when parent contain IDs array?

I am trying to implementing data-loader in my project- Here is my code- subCategory: async (parent, _, {loaders}) => { console.log(parent); // I try it but getting errors const subcategory = await…
user17578307
0
votes
1 answer

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.com/docs/apollo-server/performance/caching/#memcachedredis-setup do not appear to work…
Dom Stepek
  • 291
  • 2
  • 11
0
votes
1 answer

Has Apollo Federation support code-first approach?

I have code-first declarations on project. But I want to use them as microservices. In this case, how can i separate my typeDefs and resolvers according to Apollo's schema-first approach. Is it possible ?. I didn't find any resources that contain…
Batuhan
  • 1,521
  • 12
  • 29
0
votes
0 answers

Nodejs reading image and sending it to a graphql server with multipart/form-data

I need to read a locally stored image, embed the image to a form with form-data using the GraphQL multipart request specification, then perform a POST request to a graphql server with the body of the request being the form data itself. I read the…
momomo
  • 319
  • 1
  • 5
  • 15
0
votes
2 answers

Strapi GraphQL 413 Payload too large request error

I have this issue only in graphql. I need to POST base64 html but I didn't find any configuration for graphql to override the 1mb limitation. I already setup the middleware.js and choose upper value but it works only for REST API
0
votes
1 answer

How to retrieve an http request headers item from a symbol map?

I am trying to retrieve a particular request header from an apolloserver request (i.e. the request object from a GraphQLRequestContext), inside a a plugin. logging the headers object logs out as: Headers { [Symbol(map)]: [Object: null prototype]…
yen
  • 1,769
  • 2
  • 15
  • 43
0
votes
1 answer

Unsafe access to member with 'any' type when configuring REST data source in Apollo server with TypeScript

I am trying to configure a data source in Apollo server with TypeScript: my-rest-datasource.ts import { RESTDataSource } from 'apollo-datasource-rest'; import ResolverCtx from 'types/resolver-ctx'; import { IdType, GetResultType, } from…
Antfish
  • 1,313
  • 2
  • 22
  • 41
0
votes
1 answer

Apollo client not connecting to server when Redis cookie is set

When I try to login which sets a cookie and then I refresh the page I don't get any response from apollo server and every requests made by graphql client are kept (pending) status. After I remove a cookie, everything seems to work fine. I'm not even…
Mateusz
  • 87
  • 1
  • 8
0
votes
1 answer

Unsafe assignment of "any" value when type should be implicitly implied?

I am starting an ApolloServer instance const server = new ApolloServer({ typeDefs, resolvers, plugins: [ApolloServerPluginDrainHttpServer({ httpServer })], }); in my code the "server" constant is underlined with the error "Unsafe…
Antfish
  • 1,313
  • 2
  • 22
  • 41
0
votes
1 answer

ImportModuleError aws lambda. Cannot find module './json.js'

I am using esbuild to bundle my lambda function. here is my script for bundling dependencies: "scripts": { "build": "./node_modules/.bin/esbuild src/lambdaHandler/index.js --bundle --outfile=out/index.js --platform=node --target=node12…
0
votes
1 answer

Apollo Subscription Server returns "Must provide document."

Our firm migrated yesterday to Apollo v3 (apollo-server-express v3.4.0). Unfortunately, subscriptions return the following response: { "message": "Must provide document" } We made following observations: This is a server issue, as we experience…
0
votes
0 answers

Can't upload images using `apollo-upload-client` to graphql server `graphql-upload`

I'm trying to upload images from react-native application to apollo-server but I get the following error: message: "Variable "$photo" got invalid value { uri:…
Emad Baqeri
  • 2,333
  • 2
  • 14
  • 29
0
votes
1 answer

How can I use SWR to render data from an Apollo Server instance of GraphQL, in a NextJS app?

I can successfully view my GraphQL query via apollo-graphql-studio: The resolver is correctly configured, but I'm not sure how to render data. I know that the next-js swr react-hook is performant, so I'd like to fetch data via the swr method: import…
WΔ_
  • 1,229
  • 4
  • 20
  • 34
0
votes
1 answer

How to differentiate between a resolver call from federation and from client?

I am working in a GraphQL project using node + typegraphql + apollo-server. My goal is to have specific metrics for regular queries, and separately, from federations. Is it possible to differentiate it in the server that is being requested and…
0
votes
3 answers

error TS2416: Property 'originalError' in type 'ApolloError' is not assignable to the same property in base type 'GraphQLError'

Versions apollo-server-errors: 3.2.0 graphql: 15.6.1/ 15.7.0 nestjs-cli: 8.1.2 npm: 6.14.15 Typescript: 4.4.4 Error: node_modules/apollo-server-errors/dist/index.d.ts:10:5 - error TS2416: Property 'originalError' in type 'ApolloError' is not…
1 2 3
99
100