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.

310 questions
0
votes
1 answer

GraphQL resolver middleware for auth check

I have a GraphQL API with mixed public and private queries and mutation. I'm looking for a way to check whether an operation requires the user to be authenticated and also a permission checker, so that the user can only modify his own data. I…
Norbert
  • 2,461
  • 8
  • 47
  • 97
0
votes
1 answer

Many to Many graphql schema error

I'm new with GrpahQL and I'm trying to simulate Many to Many relationship between Users and Groups. I have the followinf types defined in my schema: // UserType.js const { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLID } =…
0
votes
1 answer

graphql-JS Express cannot resolve a field

When I execute the below code in node server. I see an error that graphql-JS cannot resolve the field "product.productTax." Using graphql-express, visual studio code, I was trying to exactly mimic the following code from…
0
votes
1 answer

Graphql nested query is extremely slow

When our project was based in REST, there was a response time of 200 ms ~ When changed the project be in GraphQL. Because of each node trying to resolve, and after the resolve, their sub-entity is resolving too. cause to a extremely high latency,…
Tal Gvili
  • 249
  • 4
  • 13
0
votes
2 answers

GraphQL. How to write resolver

I just started to get into GraphQL. I am using GraphQL.js and express. Right now I am trying to build a simple example using a hardcoded JSON as the data in my javascript file. I then want to use express middleware to listen to HTTP requests via…
Patrick Seume
  • 63
  • 1
  • 7
0
votes
1 answer

Is it possible to get a human readable, nested JSON representation of a GraphQL schema in JavaScript?

I am trying to get an object representation of our graph without writing something custom to parse the output of the introspectionQuery. Ideally this would be a JSON object that had keys of the type name and their type as the value in the shape of…
Jazzy
  • 5,536
  • 9
  • 45
  • 70
-1
votes
1 answer

GraphQLObjectType is not a constructor

I'm trying to follow a graphql tutorial, even thoughg I followed it and double checked I keep getting the above error and I have no idea why dont you really hate when the bot asks you to type more, its mostly code for a reason I dont have a clue and…
-1
votes
0 answers

How to get a response from Mutation in GraphQL?

I am very new to GraphQL and just want the mutation to give a response instead of 200 Ok with "Null". Below is the schema for it: input RecurrenceInput { frequency: Frequency! startDate: String! endDate: String beforeHoliday:…
-1
votes
1 answer

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…
-1
votes
0 answers

NodeJS Graphql server won't return anything even when i return something

i create a graphql server using express in nodejs. I tried to use query and mutation. no problem occured when i do the query. but, when i do the mutation somehting went wrong. when i didn't upload any file, and just string the mutation return string…
-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

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! …
-1
votes
1 answer

Gatsby Create Pages

I am trying to create a gatsby site where I have projects posted, each with tags. I followed a basic tutorial on creating a gatsby blog, and am now working through gatsby's tags as documented on their website. Along the way while changing variable…
-1
votes
2 answers

Alias object in graphql,

I know if my data is coming like { id: 123 address: xyz name: hello } and I want to alias name during Query I can do it like query { identification: id address full_name : name } So my data will look like this: { identification: 123 …
xoxocoder
  • 204
  • 1
  • 10
1 2 3
20
21