Tag: apollo-server
-
apollo-server-express CORS issue
25 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 the applyMiddleware function to wire up the apollo server with express. I am currently doing the following: const…
-
How to provide resolvers from different files to the apollo server (nestjs)
0 I have nestjs quiz api which serves graphql queries and mutations, i have two resolvers (for questions and quizes). To the apollo server i need schema which i have from autoSchema but i dont know how to provide this resolvers without constructors Below my three files (main.ts / quiz.resolver.ts / question.resolver.ts) import { NestFactory…
-
Any way to only cache GOOD responses in data sources?
0 Is there any way in @apollo/datasource-rest to cache "good" responses from my rest api, i.e statuses 200 to 299. I read in the datasource-rest documentation (https://github.com/apollographql/datasource-rest/blob/main/src/HTTPCache.ts#L201) that "With a TTL override, only cache successful responses but otherwise ignore method and response headers" Does that mean that adding this to my dataSource: cacheOptions: { ttl:…
-
How to fix empty schema.gql file?
0 I want to connect my frontend with backend by apollo server. Schema is generated in backend main folder and i have following settings: app.module: GraphQLModule.forRoot<ApolloDriverConfig>({ driver: ApolloDriver, autoSchemaFile: "schema.gql", sortSchema: true, playground: false, }), main.ts: import { NestFactory } from ‘@nestjs/core’; import { GraphQLSchemaHost } from ‘@nestjs/graphql’; import { AppModule } from ‘./app.module’; import…
-
Can GraphQL handle XML responses where single item arrays are converted to dictionaries?
2 I’m currently working on a GraphQL/Node/Express server that retrieves data from another API. I have absolutely no access to the other API except for the data I receive back. My problem is that the response is XML and there are certain fields that should be returned as arrays but instead are being returned as…
-
GraphQL Error: Expected undefined to be a GraphQL type
2 I have been running into this GraphQL error for the past day or so and I have a hard time pinpointing where the problem lies. I hope the following makes sense… In my project I have the following GraphQL types; Questionnaire & Question were a Questionnaire has many Questions and a Question belongs to…
-
Possible to use only one package version using pnpm?
1 I need to use apollo-server and graphql-upload to handle file uploads. This is working as expected with the old graphql-upload v9. Updating to the latest v11 results in failing uploads. To make it short, the problem is, that apollo-server (and @nestjs/graphql) are depending on the old graphql-upload v8. (For those, who are interested in…
-
ApolloServer: createAPIGatewayProxyEventV2RequestHandler — how to set up CORS?
0 I’m splitting a project into client/server sub projects, so now I have to deal with CORS issues between the client and server running under different ports on localhost. I’m using ApolloServer 4, and can’t find any documentation for setting the Access-Control-Allow-Origin header for an AWS lambda server. This is the setup: import { ApolloServer…
-
Resolve relationships in graphql using nexus
0 I’m new to using nexus and graphql but I’m having a hard time getting the following to work: I am using: "@prisma/client": "^5.4.1", "apollo-server": "^3.12.1", "graphql": "^16.8.1", "nexus": "^1.3.0", "python": "^0.0.4" And this is running in a node container (node:20-alpine3.17) My data model: I defined the types and some query definitions using the nexus…
-
Make a mutation call in angular (getting “Http failure response for https://localhost:8080/graphql: 400 Bad Request”)
0 Im new to both GraphQL and angular im trying to follow the documentation but not able to make a mutation. Below is the ts file code export const USER_SIGNUP = gql` mutation AddUser($userInput: UserInput) { addUser(userInput: $userInput) { id name email password } } `; import { Component } from ‘@angular/core’; import { Apollo…