I am currently in the process of building an Express server using Apollo 2. My schema is as follows:
const typeDefs = gql `{
type Movie {
id: ID!
title: String
year: String
rating: String
}
type Query {
movies: [Movie]
}
}`;
However, upon running the application, I encountered this error message:
GraphQLError: Syntax Error: Expected Name, found !
Below are some of the key packages I have installed (only relevant ones listed):
"apollo-server-express": "^2.8.2",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"graphql": "^14.4.2",
"graphql-tools": "^4.0.5",
In my previous experience with version 1, I did not face any issues like this. Are there any missing packages that could be causing this problem? Or perhaps a typo or syntax change that I overlooked? I've been trying to troubleshoot this for a while now without success.
Thank you, James