Improved MySQL dialect for the Join Monster GraphQL to SQL query execution layer
Obviously requires Join Monster https://github.com/stems/join-monster
Reference the dialect file in your GraphQL Query definitions:
const dialect = require('../../some-path/mysql.dialect.js');
Specify Join Monster dialectModule in your resolver:
resolve: (table, args, context, resolveInfo) => {
const sequelize = require('../../../config/database');
return joinMonster(resolveInfo, {}, sql => {
return sequelize.query(sql).then(function(result) {
return result[0];
});
}, {dialectModule: dialect});
},
Happy days!!