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

Apollo Server Subscription subscribe method is never called

I have an existing Express ApolloServer . I added subscription to that . I can see when I fire the subscription from Playground, the resolve method is called . But, the subscribe method is never called const { PubSub, withFilter } = require…
3
votes
1 answer

How to set up a different database for testing in prisma?

I want to use a different database for testing my app instead of local database. this is my env file # Environment NODE_ENV=development # Backend API_PORT=4000 APP_SECRET=omg DASHBOARD_URL=http://localhost:1234 #…
Ashik
  • 2,888
  • 8
  • 28
  • 53
3
votes
1 answer

Apollo Graphql: Rename schema for backward compatibility

What I want do ? In Apollo Graphl server, I want to change an entity Person to Human in schema but i don't want to break my clients (frontend that are querying graphql). So if client is making query for Person i want to map it to…
I.ali
  • 201
  • 1
  • 3
  • 12
3
votes
1 answer

GraphQL: field.resolve() result is undefined inside directive

I've been following all the results I found on Google on how to make an AuthDirective but I can't make it work. I'll leave all the files to see if I'm making an error on the implementation but I guess not because I tested even without having any…
3
votes
1 answer

Rejecting & error handling of GraphQL file upload

I have an express GraphQL endpoint with a resolver that accepts a single file. The resolver includes a simple validation of the file being received. The problem is that when the validation fails, there is no way to immediately return the error to…
3
votes
1 answer

is there a way to reload hasura remote schema using nodejs

I'm setting up a remote schema inside the other hasura graphql schema how can I set up the reload_remote_schema using node/express js? I'm facing below problem. Graphql remote schema data is not updating before clicking on the reload button. I don't…
3
votes
0 answers

How to use GraphQL subscriptions with Postgraphile?

I am very new to GraphQL, so maybe I am just missing something here. i am currently creating an GraphQL endpoint of a Postgres SQL Database using the PostGraphile I am able to perform queries, but i just found out about GraphQL Subscriptions and…
CESCO
  • 7,305
  • 8
  • 51
  • 83
3
votes
3 answers

Apollo Graphql Import Issue with cacheControl directive

I am using "graphql-import": "^0.7.1" I tried to add @cacheControl directive to my graphql schema type Post @cacheControl(maxAge: 240) { id: Int! title: String author: Author votes: Int @cacheControl(maxAge: 30) readByCurrentUser:…
WitVault
  • 23,445
  • 19
  • 103
  • 133
3
votes
1 answer

query mongodb with express and graphql

how do we use graph ql with mongo db here is my code with resolvers var resolvers = { test:()=>{ return getproducts() }, } const getproducts=()=>{ return new Promise((resolve,reject)=>{ Product.find({}).exec() …
subhashish negi
  • 174
  • 1
  • 9
3
votes
3 answers

How to create a delete mutation in GraphQL?

StackOverflow! One day ago I've started to learn a new thing for me - GraphQL. Now I know how to add and read objects from a database using GraphQL. I have tried to find an answer to question "how to remove an object from database". But it's no…
oles
  • 166
  • 1
  • 2
  • 10
3
votes
2 answers

GraphQL with RESTful returning empty response

I am connecting GraphQL with REST endpoints, I confirmed that whenever I am calling http://localhost:3001/graphql it is hitting REST endpoint and it is returning JSON response to GraphQL server, but I am getting an empty response from GraphQL server…
Vishrant
  • 15,456
  • 11
  • 71
  • 120
3
votes
0 answers

Parameters ordering to get context in express-graphql

I am using GraphQL and trying to get request and response object in resolver layer. Currently, I am using express-graphql. I have followed the references for apollo-server and tried to apply the…
ashu
  • 1,197
  • 2
  • 14
  • 30
3
votes
1 answer

GraphQL Error : Must provide name

I am writing mutation for logging in user in NodeJS. It is giving error "Must Provide Name". Here is Browser GraphQL Query: mutation{ login(username:"dfgdfg",password:"test1234") { _id, name{ fname, lname, mname } …
Piyush Bansal
  • 1,635
  • 4
  • 16
  • 39
3
votes
2 answers

apollo graphql schema react-admin beginner

Brand new to these technologies and am pretty pumped by what i see so far, i am having a rough time finding an example of something i am stuck on. The docs for react-admin suggest my schema for say Posts follows the allPosts and _allPostsMeta.. The…
Greg Belyea
  • 858
  • 1
  • 5
  • 15
3
votes
1 answer

Generating GraphQL GUI from Schema and Schema from GUI

While using GraphiQL works well, my boss has asked me to implement a user interface where users can check elements presented to them via UI elements like checkbox, map relationships and get the data and doing this will generate a graphql input for…
Vignesh T.V.
  • 1,790
  • 3
  • 27
  • 48