Category : graphql

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 ";". Index.JS: const { ApolloServer } = require(‘apollo-server’); const gql = require(‘graphql-tag’); const typeDefs = gql`; type Query{ SayHi: ..

Read more

I’m using Apollo client’s setContext and createHttpLink functions to out the JWT token from storage onto the request header but I keep getting an error: [Unhandled promise rejection: Error: Response not successful: Received status code 500] When I create the apollo client object like this my app runs perfectly fine: const client = new ApolloClient({ ..

Read more

I am using reactjs and graphql. I want to get similar data of colleges belonging to same states. The data is in form of array: colleges:[ {collegeName ,id, state}, {collegeName ,id, state}, {collegeName ,id, state} ] My graphql query: similarColleges: { type: new GraphQLList(CollegeType), args: { id: { type: GraphQLID }, }, resolve(parent, args) { ..

Read more