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
0
votes
1 answer

Postgraphile VS custom graphql resolver/schema in express server

I was experimenting with Postgraphile and it is a great tool to auto-generate the GraphQL API but I am still a little bit confused why should I use it. (P.S. I am not very experienced with GraphQL and PostgreSQL.) Question 1: Can I think of it this…
calvert
  • 631
  • 10
  • 33
0
votes
1 answer

How can i add/subtract values in Graphql and store it in a collection (For eg. Like a wallet and transaction system)

I am a newbie in graphql and have a use case where I have to add or subtract all the transactions in real-time. For eg. Someone credited to an account the wallet of that person should be updated automatically. I have successfully written the code…
Aryan Soni
  • 236
  • 4
  • 15
0
votes
1 answer

Applying cookie returned from REST api call via GraphQL

When implementing an auth GraphQL module a resolver calls an external API via RESTDataSource. async logout() { return await this.post('/logout', { credentials: 'include' }) } This return an empty body object (expected) and headers that include *…
Paul
  • 363
  • 5
  • 15
0
votes
2 answers

GraphQL Query worked, now returns null;

So I am trying out GraphQL and I've run into a weird issue. The same query that returned data , now returns null. I am using a dummy "database" in form of an array This issue appeared when I tried to add a new array and type, Authors. I've deleted…
0
votes
1 answer

How to get all graphql schema query, mutation, subscribe

I am using nodejs with graphql and graphql-compose so i define scheme as schemaComposer.Query.addFields({ Me: MyResolvers, Info: MyInfoResolvers, Post: PostResolvers }) schemaComposer.Mutation.addFields({ Login: MyLoginResolvers, …
0
votes
0 answers

can't run apollo-server-express with merged typeDefs and resolvers using @graphql-tools/merge

hey friends this is the structure of my project and files down below: starting from app.js file: import { Server } from "./src/Server"; import { config } from "dotenv"; config(); Server.StartServer(); Down below is the Server.ts file that is…
Emad Baqeri
  • 2,333
  • 2
  • 14
  • 29
0
votes
0 answers

What are the best practices for managing huge schema using express-graphql

I'm seeking advice. My schema.js file is reaching 1000 lines and I'm only halfway. What would be a decent file structure to spill schema.js onto?
arturasmckwcz
  • 104
  • 1
  • 7
0
votes
0 answers

How to Implement Interfaces or Unions in Express-GraphQL

I am using express-graphql and I am trying to implement interfaces, like here and here. However, I do not know how to implement those, since the notation people use is totally different from what I am used to in nodejs. In the second answer, for…
0
votes
0 answers

How should I reference grandparent properties in a GraphQL query, where I don't define the intermediate resolver?

I am building a GraphQL Schema that has a Type Pod which contains 3 nested objects. type Pod { metadata: Metadata spec: Spec status: Status } My data source is an external API which returns an array of this data. In fact, I defined my…
Brian Barr
  • 19
  • 7
0
votes
1 answer

org.dataloader.DataLoaderRegistry error while initialization of Graphql application

I am using below set of jar in my application. compile files('libs/latest/graphql-java-servlet-6.1.3.jar') compile files('libs/latest/graphql-java-16.2.jar') compile files('libs/latest/graphql-java-tools-5.2.4.jar') compile…
0
votes
2 answers

The field input type 'Long' is not present when resolving type 'Query' [@6:1]

While to initialize the graphql schema I am getting below error stacktrace. Invocation of init method failed; nested exception is SchemaProblem{errors=[The field input type 'Long' is not present when resolving type 'Query' [@6:1], The field type…
0
votes
1 answer

How to attach variables to the Graphql context?

I am using express-graphql. I want to attach some params to the context, but they don't attach. Middlware: app.use(graphqlHTTP({ schema: schema, rootValue: resolver, graphiql: true, context: {someValue: 100} })) Schema: type Query { …
MichaelLearner
  • 429
  • 4
  • 14
0
votes
0 answers

Invalid Syntax error while consuming graphql API

I am also facing some issue while hitting Graphql APIs through postman. http://testEnvrironment/restcall/getReports POST body getReports(id:15){ isApproved } } Entries of sample.graphqls file is schema{ query: Query } type…
0
votes
0 answers

Error GraphQL "The type of Query.GetUser must be Output Type but got: undefined."

Writing my First Graphql and came across this problem. Data is not showing index.js: const express = require('express') const app = express() const graphql = require('graphql') const {graphqlHTTP} = require('express-graphql') const { GetUser ,…
0
votes
1 answer

GraphQLError [Object]: Syntax Error: Cannot parse the unexpected character ";"

While I was setting the server, connecting to the MongoDB database, and doing a mutation, I'm getting the following error after running node index in my terminal: GraphQLError [Object]: Syntax Error: Cannot parse the unexpected character…
anon_user
  • 9
  • 2