apollo-server Questions

2

I can't figure out how to handle auth error in my authMiddleware function. Here is my authMiddleware function with traditional express way error handling. const jwt = require('jsonwebtoken'); con...
Serpentiform asked 2/8, 2018 at 2:53

2

Solved

is there a way how to run an exception through the apollo exception handler manually? I have 90% of the application in GraphQL but still have two modules as REST and I'd like to unify the way the ...
Tavis asked 18/5, 2020 at 7:56

1

I am trying to set a static cacheControl on some fields, as done here From my understanding, I need to use a directive, so I used the following nest documentation to declare directives So, I built ...
Shaum asked 20/6, 2022 at 7:15

3

const { ApolloServer, gql } = require('apollo-server-express') const express = require("express"); const next = require("next"); const dev = process.env.NODE_ENV === "development"; cons...
Hemostat asked 28/12, 2018 at 6:25

3

I have an operation getFoo that requires that the user is authenticated in order to access the resource. User authenticates using a mutation authenticate, e.g. mutation { authenticate (email: "f...
Gonagle asked 12/10, 2017 at 20:51

3

I’m using the newer version of apollo server V4, I need assistance on how to upload images or videos from Frontend to cloudinary and save the url to MongoDB database… please help 🙏 I have read thr...
Teide asked 26/10, 2022 at 18:35

6

So I am migrating to apollo-server-express 2.3.3 ( I was using 1.3.6 ) I've followed several guides, making the necessary tweaks but am stuck in a CORS issue. According to the docs you have to use ...
Rodger asked 1/2, 2019 at 18:29

6

Solved

I am currently loading the GraphQL schema using a separate .graphql file, but it is encapsulated within strings: schema.graphql const schema = ` type CourseType { _id: String! name: String! }...
Fastback asked 9/6, 2020 at 19:59

1

What is the correct implementation for receiving file uploads from a client on a server utilizing the following combination of packages/techniques (and their corresponding dependencies not listed):...
Ramberg asked 5/11, 2019 at 23:10

6

In my next.js app I am trying to configure the Apollo Endpoint: import { ApolloServer, gql } from "apollo-server-micro"; // This data will be returned by our test endpoint. Not sure if I...
Ingar asked 11/8, 2021 at 15:51

3

I am using graphql ApolloServer and using following for Apolloserver server.applyMiddleware({ app, path: '/graphql' }); And I need to pass the error returned from the resolvers in the response h...
Activator asked 8/9, 2019 at 15:14

4

Solved

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-server-express? If there isn't, how do...
Meng asked 20/11, 2018 at 2:52

3

My web app is using: NextJS NextAuth.js Apollo Server I have a NextAuth set up in my app, and I am able to log in just fine. The problem is coming from trying to get access to the user's session ...
Dressler asked 19/1, 2021 at 22:33

3

I am trying to query by passing the variable id in the query variable window. This results in an error "Variable \"$id\" of required type \"ID!\" was not provided." When I run a different query ...
Finned asked 29/11, 2018 at 17:56

7

Solved

When using apollo-server 2.2.1 or later, how can one log, for each request, the query and the variables? This seems like a simple requirement and common use case, but the documentation is very vag...
Vacillating asked 20/1, 2019 at 2:52

1

Solved

I am trying to run Apollo GraphQL server inside my AWS lambda. I'm using the library from here. I'm also using CDK to deploy my lambda and the REST API Gateway. My infrastructure is as follows: con...
Protrusive asked 29/1, 2023 at 22:37

1

Solved

I have been trying to install typegraphql with apollo/server in typescript node template but it showing dependency error, I don't know why all new version is not compatible with each other. npm ERR...
Alluring asked 18/1, 2023 at 1:41

2

Solved

this my code schema gql` type Query { user: X! } type User { name: String! } type Time { age: Int! } union X = User | Time `; resolvers { X: { __resolveType: obj => { if (obj.n...
Eagle asked 29/12, 2019 at 13:23

2

Solved

When using Apollo Server to write a GraphQL server, how can I run a command on the server to generate the schema.graphql file for the client to consume? Note: I'm not using the Apollo Client, I'm u...
Diehl asked 20/6, 2020 at 7:53

1

We are receiving this error Error: [internal apollo-server error] willResolveField called after stopTiming!, this is leading to unhandled rejection and frequent restart of node server. Any insight ...
Blemish asked 26/8, 2020 at 10:32

3

Solved

How can I disable graphiql on production but still able to access it on development? With express-graphql we can do something like app.use('/graphql', graphqlHTTP({ schema: MySessionAwareGraphQLSc...
Gabriellegabrielli asked 23/7, 2017 at 12:4

4

Solved

After updating the apollo-server to version 3 the following error is shown in the console C:\projects\my_project\node_modules\apollo-server-core\src\ApolloServer.ts:554 throw new Error( ^ Error: ...
Gilmer asked 1/8, 2021 at 21:33

4

Solved

I am running Apollo lambda server for GraphQL. I want to intercept the GraphQL query/mutation from the POST request body and parse it so I can find out which query/mutation the request is asking fo...
Wharf asked 1/3, 2018 at 10:9

2

I think I am just using this module wrong and that is the reason I am getting an error. According to the documentation I can pass an array of resolvers and schemas to the mergeSchemas function from...
Zerk asked 29/3, 2019 at 16:5

2

Solved

How do we pass headers to Apollo server executeOperation in tests? There is mention about passing a headers object here I'm trying to pass an auth header with or without a JWT token to test access ...
Stanfordstang asked 15/8, 2021 at 22:25

© 2022 - 2024 — McMap. All rights reserved.