Skip to content

Commit

Permalink
pushed new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alirizwan committed Dec 2, 2023
1 parent b3b8aa3 commit 2faab6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions examples/sequelize-graphql-schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,22 @@ const { generateSchema } = require('../src/index')({
const app = express();
const models = require('./models');

app.get('/', expressPlayground({ endpoint: '/' }));

app.all('/', async (req, res) => {
const schema = await generateSchema(models, req);

const handler = createHandler({
schema: new GraphQLSchema(schema),
graphiql: true,
context: {
req
}
});

handler(req, res);
});

app.get('/gql', expressPlayground({ endpoint: '/' }));

app.listen(3000, () => {
// eslint-disable-next-line no-console
console.log('RUNNING ON 3000');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphcraft",
"version": "1.1.5",
"version": "1.2.1",
"description": "Rapildy build and extend GraphQL API based on Sequelize models. This library helps you focus on business logic while taking care of GraphQL schema automatically.",
"main": "src/index.js",
"scripts": {
Expand Down

0 comments on commit 2faab6a

Please sign in to comment.