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
8
votes
2 answers

ApolloServer using mergeSchemas, Error: Apollo Server requires either an existing schema, modules or typeDefs

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 graphql-tools. But I am getting this error: Error:…
Taylor Austin
  • 5,407
  • 15
  • 58
  • 103
8
votes
2 answers

CORS preflight response doesn't match actual response

In my node.js server I have included CORS as middleware like so: app.use(cors({ origin: 'http://:3030', credentials: true })) I'm using Apollo Client in the app that sends the request, and have set credentials to 'include' when…
Jake
  • 3,865
  • 5
  • 25
  • 58
8
votes
2 answers

How to use or resolve enum types with graphql-tools?

I cannot find anywhere in the graphql-tools documentation how one should go about utilizing enum types in schemas that are fed to makeExecutableSchema. Anyone have a clue how this done? Example code: enum Color { RED GREEN BLUE } type Car { …
Dallas
  • 888
  • 3
  • 10
  • 24
8
votes
0 answers

Authenticate Apollo GraphQL API with Passport Facebook

I have a client server and an API, both using Apollo. When the user logs in with Facebook I want to send a token to my client server which will then be appended to the headers of every request made to the API. Without using sessions. Here's how the…
8
votes
1 answer

GraphQL: Filtering, sorting and paging on nested entities from separate data sources?

I'm attempting to use graphql to tie together a number of rest endpoints, and I'm stuck on how to filter, sort and page the resulting data. Specifically, I need to filter and/or sort by nested values. I cannot do the filtering on the rest…
onthegojohn
  • 216
  • 2
  • 4
7
votes
1 answer

AWS Graphql lambda query

I am not using AWS AppSync for this app. I have created Graphql schema, I have made my own resolvers. For each create, query, I have made each Lambda functions. I used DynamoDB Single table concept and it's Global secondary indexes. It was ok for…
Krisna
  • 2,854
  • 2
  • 24
  • 66
7
votes
1 answer

Serverless handler for Apollo Server throws error that it cant identify events on Netlify

Context: I am trying to deploy GraphQL using Apollo Server Lambda through Netlify. My handler is as below: Code: exports.handler = server.createHandler({ cors: { origin: '*' } }); I was able to build and deploy successfully on Netlify -…
Guru
  • 71
  • 2
7
votes
3 answers

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 property declarations must have the same type. Property 'cacheControl' must be of type…
7
votes
3 answers

How to solve Apollo Studio Sanbox Cors?

I can't use apollo Studio. After migration for Graphql playground. When I try to run in localhost and redirect me to apollo studio sanbox https://studio.apollographql.com/sandbox?endpoint=http%3A%2F%2Flocalhost%3A5018%2Fgraphql: Unable to connect to…
lohnsonok
  • 471
  • 6
  • 12
7
votes
1 answer

Apollo Server: How to access 'context' outside of resolvers in Dataloader from REST API Datasource

hopefully someone can help me with this little problem, I just cannot figure it out right now. Problem Statement: I want to access 'context' for the sake of authentication in my DataLoader. This DataLoaderis defined in a seperate path /loaders. In…
ilikejs
  • 73
  • 1
  • 4
7
votes
3 answers

Apollo Server with subscriptions used inside next.js api routes: websockets trouble

i try to setup GraphQL Subscriptions inside a next.js 9.x app. The app is totally fake, it is just for trying Apollo Server subscriptions. The "database" is just an array, where I push new users to it. This is the code I got so far. import {…
7
votes
3 answers

Apollo Server: pass arguments to nested resolvers

My GraphQL query looks like this: { p1: property(someArgs: "some_value") { id nestedField { id moreNestedField { id } } } } On the server side, I'm using Apollo…
Tdy
  • 863
  • 12
  • 28
7
votes
1 answer

Upload files from Angular 7 Web App to Apollo 2.0 GraphQL Server

I am trying to upload files with Angular Apollo as Client and Apollo 2.0 as Server. Trust me, I tried every tutorial, example I could find on the internet but no help. There's a library called apollo-upload-file they have given an example of how to…
DDD
  • 119
  • 3
  • 10
7
votes
1 answer

Increasing body limit size in apollo-server-express

I am trying to upload files to a webservice using the Upload scalar in apollo-server-express. I can upload small files(10s of kbs) to the webservice but am having trouble getting larger files to send. I did some searching and found that I can…
Exuro
  • 229
  • 3
  • 15
7
votes
1 answer

Returning data from apollo-server based on a filter for a nested field

Is it possible to return data for a query in apollo that is based on a filter for a nested field? For example: Query: Users($filter: String!) { user(filter: $filter) { id, name, address(filter: $filter) { street, …
Jonathan Beadle
  • 418
  • 2
  • 7