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

GraphQl Array Schema

I have a response from an external API genre_ids: [0: 16, 1: 21, 2: 46]; At this point, I have no clue how to define a schema for something like that.
Ivan Baranov
  • 355
  • 2
  • 3
  • 10
0
votes
1 answer

GraphQL : queries : cannot get data from MongoDb

I get this error : "errors": [ { "message": "Type Query must define one or more fields." } ] when I run my query : { user{ _id name username password email date_inscription profession } } I have…
0
votes
2 answers

dataloader facebook optimization

everybody! I'm trying to use Dataloader by facebook in my graphql project. So, now I'm faced to the next problem. When I ask my database for data by ids for example: select * from books where books.author in (4,5,6,7) I got an Error: "function did…
0
votes
1 answer

How can I access all elements with a particular attribute in graphQL?

I have some json data in file called countryData.json structured as so: { "info":"success", "stats": [{ "id":"1", "name":"USA", "type":"WEST" }, //... I'm using graphQL to access this data. I have created an object type in the schema…
ram
  • 39
  • 1
  • 1
  • 5
0
votes
0 answers

uncaughtException - GraphQLError: The request is invalid

What I trying to do is to add customize message by using GraphQLError when user login fails. Here is the GraphQL Endpoint Code in app.js file: app.use('/graphql', graphqlExpress(req => ({ schema, context: { user: req.user }, …
Piyush Bansal
  • 1,635
  • 4
  • 16
  • 39
0
votes
1 answer

GraphQL mutation returns only one result

I just started to learn GraphQL and did a simple example. I have this schema const { GraphQLObjectType, GraphQLString, GraphQLSchema, GraphQLID, // GraphQLInt, GraphQLList, GraphQLNonNull } = graphql; const…
Andi Domi
  • 731
  • 2
  • 19
  • 48
0
votes
1 answer

GraphQL - Schema Delegation on Schema Stitching is not working if the Parent return type is a list of Objects

I have a Publication object that includes an imageId which I want to use to create a schema delegation and load the whole object. Publication Type is defined as: const PublicationType = new GraphQLObjectType({ name: 'Publication', description:…
Adel Bachene
  • 974
  • 1
  • 14
  • 34
0
votes
4 answers

Error: Expected [object Object] to be a GraphQL type

This code was working until I added the Resources part into the code. It is similar to the other two so I am not sure why isn't it working. Thanks in advance Update:- After using the debugger, I came to understand that the problem is in the…
Vikranth
  • 1,538
  • 1
  • 14
  • 23
0
votes
1 answer

Graphql mutation query not working with express-graphql

I am new to graphql. I am using express-graphql to generate graphql queries on REST APIs for petSore schema. I am able to get the result for GET APIs using graphql Queries but I am unable to get response for POST/PUT APIs using Mutations. ) To…
zulekha
  • 313
  • 9
  • 17
0
votes
2 answers

GraphQL Connections

I have this relationship btw a user and its memberships. The memberships field is a connection between a user and multiple memberships. const MembershipType = new GraphQLObjectType({ name: 'Membership', interfaces: [nodeInterface], …
Nizar AYARI
  • 203
  • 2
  • 12
0
votes
1 answer

graphql: rest API join

I'd like to know if there is a way to join two rest API on the name attribute using graphql. These are the response that I have // products API [ { id: "0001", name: "a name", color: "black", size: "L" }, { id: "0002", name: "an other…
user3849960
  • 120
  • 2
  • 11
0
votes
2 answers

GraphQL [graphql js] circular dependencies: The type of * must be Output Type but got: [object Object]

EDIT added my solution as an answer ORIGINAL QUESTION i believe this issue has to do with circular dependencies. i spent the better half of last night and today trying everything i could find online but nothing seems to work. what i have…
vampiire
  • 1,111
  • 2
  • 15
  • 27
0
votes
0 answers

GraphQL Subscription Authentication Using AsyncStorage

Am trying to use subscription on my client app to send JWT Token and refreshToken to the server using WebSocketLink connectionParams. But the problem is that my token and refreshToken are saved inside AsynStorage that require me to use async await…
Emmanuel
  • 121
  • 5
0
votes
0 answers

JWT authentication in Node.js + express-graphql + passport

I'm writing a fullstack application using MERN and I need to provide authentication using JWT-tokens. My code looks like: router.use(GraphQLHTTP( (req: Request, res: Response): Promise => { return new Promise((resolve, reject) => { …
Danylkaaa
  • 151
  • 1
  • 11
0
votes
1 answer

Create nested mutations in GraphQL

Would it be possible to create nested mutations on a GraphQL back-end? I have 3 tables in postgresql which are all related. I wanted to know if its possible to nest 3 separate mutations within a parent mutation (which will all do 3 separate INSERT…
JohnSnow
  • 6,911
  • 8
  • 23
  • 44