expressGraphQL is not a function

Please replace your expressGraphQL with graphqlHTTP as it was destructured Use: const { graphqlHTTP } = require(‘express-graphql’); or const expressGraphQL = require(‘express-graphql’).graphqlHTTP This is because a method called graphqlHTTP exist in the express-graphql module and you are destructure with another method name that does not exist in the module I also noticed that you have … Read more

Notable differences between buildSchema and GraphQLSchema?

The buildSchema function takes a schema in SDL (schema definition language) and returns a GraphQLSchema object. Given two identical schemas generated with each method, runtime performance would be the same. Startup time for a server using buildSchema would be slower since parsing the SDL adds an extra step that would not otherwise exist — whether … Read more

In Relay, what role do the node interface and the global ID spec play?

The Node root field, in combination with globally unique IDs, comes into play when Relay needs to refetch an object. Refetching occurs when you call this.props.relay.forceFetch() or when you add fields to the query for an object whose global ID is known because it has already been partially fetched. In cases like these, Relay will … Read more

How to query list of objects with array as an argument in GraphQL

You can definitely query with an array of values! Here’s what the query itself would look like: { events(containsId: [1,2,3]) { … } } And the type would look something like: const eventsType = new GraphQLObjectType({ name: ‘events’, type: // your type definition for events, args: { containsId: new GraphQLList(GraphQLID) }, … }); If you … Read more