Questions tagged [apollo-server]

Apollo Server, the ingenious creation written in TypeScript, offers an exceptional GraphQL server experience for Express, Connect, Hapi and Koa.

Easily switch to using String id instead of ObjectId when working with MongoDataSource in Apollo Server

We are currently working with a MongoDB database that uses string IDs instead of the typical 12 bytes or 24 hex format. These IDs were generated by MeteorJS. As we develop a GraphQL layer using apollo server, we encountered an issue when trying to load da ...

The CORS preflight response does not align with the actual response received

In my node.js server, I have implemented CORS as middleware in the following manner: app.use(cors({ origin: 'http://<CORRECT_ORIGIN_URL>:3030', credentials: true })) Within my app, I am utilizing Apollo Client to send requests. During th ...

"Although the Set-cookie is present in the response header, it is not being properly

I developed a GraphQL server using apollo-server-express, and it is currently running on localhost:4000. Upon sending a query from GraphQL playground, the response includes a set-cookie in the header: response header However, when checking the storage > ...

Sending httponly cookies with Apollo GraphQL server

Objective: I want my API gateway to retrieve the HTTPOnly cookies returned by my REST endpoints and forward them to the frontend. Additionally, the frontend should have the capability to transmit these cookies as well. httpO=httponly SPA(react) ...

Tips for automatically handling network errors with Apollo Client

Within my organization, we utilize an application that utilizes React, express, Apollo Server, and Apollo Client to showcase data from various sources. This app regularly updates the displayed data using a polling method. However, whenever I make code upda ...

Encountering an error of TypeError while attempting to generate a new GraphQL

Currently using Apollo-Server/TypeScript with graphql-tool's makeExecutableSchema() to set up schema/directives. Encountering an error while attempting to add a basic GraphQL Directive: TypeError: Class constructor SchemaDirectiveVisitor cannot be in ...

The PubSub feature is not functioning on the client side, however, it is operational on the Graphql playground, an error message displaying "TypeError:

I am currently in the process of developing a Social app utilizing MongoDB, Express, React, Node, Graphql with Apollo. I found a helpful tutorial on freecodecamp which I am following: Link to the video To achieve real-time functionality, I am implementing ...

Apollo Express does not include the Express Passport Session feature

After integrating my express server with passport for user authentication on our portal, there seemed to be an issue when trying to fetch user details from our API using the same session from the client. While I could see identity provider data for the log ...

Transitioning Apollo Server from version 3 to version 4 within a next.js environment

Previously in v3, you could define "createHandler" like this: export default async (req, res) => { await startServer; await apolloServer.createHandler({ path: "/api/graphql", })(req, res); }; However, in v4, this is no longer possi ...

What is the process for integrating Express middleware after implementing Apollo-Server v2 middleware?

I've encountered a unique issue while working with Express and Apollo Server. Despite searching online for solutions, it seems like this requirement is specific to me. My dilemma arises when I attempt to integrate an Express middleware after using the Apo ...

Switching from utilizing apollo-server-micro to upgrading to apollo server 4

While it may seem like a simple task, I'm having trouble understanding the documentation for migrating to Apollo Server 4. My current setup involves using Next.js as a framework without Express, and I'm aiming for a serverless architecture. Belo ...

Execute a graphql query within the fetch function

Need help with calling a GraphQL query within the fetch method. Can anyone guide me on how to achieve this? Specifically, I need to execute the following query inside the fetch method: query AddressList($street:String, $city:String, $state:String, $zip:St ...

Playing around with Apollo-server and Prisma 2

I'm having trouble using JEST with Prisma 2. Whenever I run a simple test, I encounter an unusual error message: npm run test > [email protected] test /Users/jeremiechazelle/Sites/prisma2/server > env-cmd -f ./env/.env.test jest --watchAll ...

What is the method for incorporating a variable into a fragment when combining schemas using Apollo GraphQL?

In my current project, I am working on integrating multiple remote schemas within a gateway service and expanding types from these schemas. To accomplish this, I am utilizing the `mergeSchemas` function from `graphql-tools`. This allows me to specify neces ...

Utilize inherited interface properties in implemented types for graphql operations

I am working with an interface called Book that includes 10 fields in TypeScript: interface Book { field1: String field2: String field3: String # it has 10 fields } Now, I want to implement this interface in 10 different types without having to manua ...

Implementing file uploads using graphql-upload library, integrating it with apollo-server-fastify, and taking advantage of the code-first

Is there a correct way to implement file uploads from a client to a server using the following combination of packages/techniques (along with their corresponding dependencies not listed): graphql-upload apollo-server-fastify @nestjs/platform-fastify (co ...