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:

1540 questions
0
votes
1 answer

Apollo: Accessing updateQuery via Props Query Option?

I'm studying the pubsub code in GitHunt-API and GitHunt-React. I see this code: const withData = graphql(COMMENT_QUERY, { options({ params }) { return { variables: { repoName: `${params.org}/${params.repoName}` }, }; }, props({…
VikR
  • 3,484
  • 3
  • 34
  • 70
0
votes
0 answers

Apollo Mutation Code for Supporting Pub-Sub?

I'm working on implementing the new Apollo pubsub code using sample code from GitHunt-API and GitHunt-React. Here is my resolver mutation code before working on pubsub. This works: Mutation: { createIM: (__, args) => { return…
VikR
  • 3,484
  • 3
  • 34
  • 70
0
votes
1 answer

What does the GraphQL schema/resolver look like for an object of objects?

data { user_id: 'abc', movies: { '111': { title: 'Star Wars 1' }, '112': { title: 'Star Wars 2' } } } What would the schema and resolver for this look like? This was my best…
atkayla
  • 6,193
  • 11
  • 53
  • 99
0
votes
1 answer

Apollo Publish & Subscribe Error: Cannot Query Field?

I'm working on learning the new Apollo pubsub code, using examples from GitHunt-API and GitHunt-React. When I call subscribe on the client, I'm getting the console log error: "Cannot query field "createIM" on type "Subscription". I've tried to…
VikR
  • 3,484
  • 3
  • 34
  • 70
0
votes
2 answers

Apollo/GraphQL: Setting Up Resolver for String Fields?

In GraphiQL at http://localhost:8080/graphiql, I'm using this query: { instant_message(fromID: "1"){ fromID toID msgText } } I'm getting this response: { "data": { "instant_message": { "fromID": null, "toID":…
VikR
  • 3,484
  • 3
  • 34
  • 70
-1
votes
0 answers

redirected from 'http://localhost:4000/graphql') from origin 'http://localhost:3000

I am trying to implement 'github authentication' in my app. However, I am getting cors issue saying Access to fetch…
Serenity
  • 3,000
  • 4
  • 20
  • 59
-1
votes
0 answers

GraphQL error: Cannot read property 'pipe' of undefined

In my graphql app, I have a single file upload resolver as following, async singleFileUploadResolver( parent, { file }: { file: ApolloServerFileUploads.File } ): Promise { const { stream,…
-1
votes
0 answers

Issue calling Apollo graphqlAPi usin useQuery

i am tring to call an APi using graphql, the start date and end date is appending to variables not inside query, i know i am sending it as variables, how can i send data so that it will be added to query const { loading, error, data, refetch } =…
Tej
  • 33
  • 5
-1
votes
1 answer

How do I get GraphQL to get live/new data from database without polling?

I have a backend running GraphQL, MongoDB + Mongoose, and Apollo. This application has functionality for user accounts and a friends list. Each user can login to their account and see a list of friends with their current 'status'; If a friend…
mikep17
  • 3
  • 3
-1
votes
1 answer

Unknown type "Upload" - Apollo Server Express with graphql-upload Node 14

I am working with GraphQL and is facing an issue with File Upload. My Node version is v14.16.0 I am getting error as below Error: Unknown type "Upload". Did you mean "Float"? Below are the package version installed Package versions "dependencies":…
Manoj Sethi
  • 1,366
  • 5
  • 20
  • 45
-1
votes
1 answer

Can we return a string or object in grapqhl while resolving?

I wanted to check whether the user exists in database ... if user exists in the database then send type user{ name email password username } or if user doesn't exist in database then send a string which tells "user doesn't exists in…
Mark ellon
  • 99
  • 6
-1
votes
1 answer

How to fetch the data from database for resolver in graphql

I Have Created two File index.js const {ApolloServer,gql} = require('apollo-server'); const fs = require('fs'); const path = require('path'); const typedefs = gql` type Query { info: String! ask: [Person!] } …
Mark ellon
  • 99
  • 6
-1
votes
1 answer

Q: Writing GraphQL resolver that uses mysql2 query

Noob question. I'm trying to write an Apollo Server GraphQL resolver that will query and return a user from a MySQL database. This is what I have so far: const UserQueries = { user: (_, args, { pool }) => { let data = {}; pool.query( …
-1
votes
1 answer

cors error preflight alow origin mismatch for apollo client and sever

Overview I am trying to get authentications set up in Apollo but I keep running into this network error: CORS error PreflightAllowOriginMismatch. I have looked and tried so many solutions on the internet but nothing is working. I have my client…
-1
votes
1 answer

graphql type error property "some" undefined

i am a beginer to start a graphql project i have created index.js file and i write some code after reading documentation here is my code import express from 'express'; const { ApolloServer } = require('apollo-server'); import resolvers from…
kukab
  • 331
  • 1
  • 12
1 2 3
99
100