Questions tagged [express-graphql]

GraphQL HTTP Server Middleware

Create a GraphQL HTTP server with any HTTP web framework that supports connect styled middleware, including Connect itself, Express and Restify.

386 questions
1
vote
0 answers

I have multiple mongoose schemas referenced into each other. I am using gql-compose-mongoose. How to push the objectID of one document into other?

I am creating a gql express server and i have created multiple schemas and referenced those schemas into each other. Assume collection USERS. Each user will have multiple challenges(schema or collection - challenge). I want to store the…
1
vote
1 answer

GraphQL Mutation and Query: Cannot read property of undefined

I'm following along a tutorial and have a simple setup using express-graphql. I have a mutation to create a Friend object and a Query to return the same. Auto-complete and schema detection work fine at GraphiQL running at localhost:8080/graphql. I…
cliqer
  • 201
  • 3
  • 9
1
vote
1 answer

Field can only be defined once graphql

I have 2 subgraphs I have this code in the subgraph for template and fileserver I call buildFederatedSchema 2 time since I have 2 subgraphs in the server list this the code in modified buildFederatedSchema gives me this error what should I do?
1
vote
1 answer

GraphQL How to seperate Server errors from Client errors (ideally using TryCatch blocks) in node.js?

try { const res = await UserModel.findOne({username: username}) if (res === null) { throw new Error("Your username or password was incorrect USERNAME") } const passwordValid =…
momomo
  • 319
  • 1
  • 5
  • 15
1
vote
2 answers

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,898
  • 8
  • 26
  • 56
1
vote
2 answers

How to define array type for multiple or nested json data from REST API

I'm new to GraphQL thingy. I have a problem in fetching array data from API using express-graphql server and I find to hard the solution somewhere. Here is the scenario. I have a GET data from REST API which has the response that similar like this…
Billy
  • 95
  • 9
1
vote
1 answer

graphql.GraphQLSchema: what type of argument to use to grab the query to pass to mongo db.collection.find to resolve the query

I'm learning ho to develop GraphQL service with express, express-graphql, **graphql, mongoose, db.collection.find has an optional query parameter that specifies selection filter using query operators. I wonder if it is possible to define a schema…
Franco Rondini
  • 10,841
  • 8
  • 51
  • 77
1
vote
1 answer

Express/GraphQL advice

I'm learning GraphQL and looking for some guidance on if I'm on the right track, or if I'm just completely off base here. Essentially, I've written my backend with express-graphql and Prisma, I've seen a few different tutorials that seemed to write…
1
vote
1 answer

Meaning of "Expected undefined to be a GraphQL type"?

I am setting up my first GraphQL endpoint with graphql and graphql-express. My MongoDB schema has two types: User and Card, where a User can have many Cards. I set up the root types and resolvers with no issues. I can query and mutate users and…
1
vote
1 answer

Cast to string failed for value \"{ details: '233' }\" at path \"setno\" for model \"Trains\

I have been trying to see and Resolve it but ended up with no relevant solution all over. Need More Inputs and Suggestions to solve this Issue. Please Check My Below Code Details. I am Using Express GraphQL,and mongoose version :^5.9.25 I am Using…
Rakesh Patil
  • 91
  • 2
  • 10
1
vote
1 answer

merge different schema in graphql

schema.js const { buildSchema } = require('graphql'); module.exports = buildSchema(` type Booking { _id: ID! event: Event! user: User! } type Event { _id: ID! title: String! description: String! price: Float! …
Shubham Sharma
  • 321
  • 1
  • 6
  • 18
1
vote
2 answers

Mongodb _id has two different datatypes in same collection

The project i m working on uses mongodb as DB and has a mock data generator. when data is generated via mock data generator it creates objects with string ids into db. And our backend application Spring boot with spring data mongodb stores new…
1
vote
1 answer

Vue-Apollo GraphQL Mutation not properly getting invoked

So hey, I have a Express GraphQL API Server (hooked up to a SQLite DB) with CORS enabled. I'm using Vue-Apollo and the Apollo Client to try and send mutations but for some reason it isn't probably inserting. Manually running the mutation through the…
animusdx
  • 380
  • 3
  • 16
1
vote
0 answers

Apollo Server vs Apollo-server-express

I understand that we need apollo-server-express if we want to have multiple endpoints or want to serve REST APIs but is there any advantage of using it over apollo-server for running a GraphQL server?
1
vote
0 answers

How to get same nested object in GraphQL

I have one collection call person, which have few field :- { "_id": { "$oid": "5f26e8ef969cc80d9710b250" }, "firstName": "xxxxxxx", "lastName": "xxxxxx", "email": "xxxxxxxx@gmail.com", "userName": "xxxxxx", …