Simple demo GraphQL Server connecting to MySQL using sequelize
Assuming nodejs is installed:
npm install
npm run dev
- Navigate to
localhost:4001/graphql
query {
users{
id
firstName
}
user(id:1){
firstName
}
}
nodemon
is used to restart the app when any files in the directory changesexpress-graphql
servermodels/user
- using sequelize to connect to mysqlschema/user_type
- defining UserType GraphQLObjectType