Skip to content

Commit 98f3678

Browse files
committed
Fix initQuery
1 parent 0ad59d5 commit 98f3678

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/index.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
import { GraphQLServer, PubSub } from 'graphql-yoga';
2-
import { formatError } from 'apollo-errors';
3-
import * as jwt from 'express-jwt';
4-
import * as faker from 'faker/locale/en';
5-
import * as compression from 'compression';
1+
import { GraphQLServer, PubSub } from 'graphql-yoga'
2+
import { formatError } from 'apollo-errors'
3+
import * as jwt from 'express-jwt'
4+
import * as faker from 'faker/locale/en'
5+
import * as compression from 'compression'
66

7-
import resolvers from './resolvers';
7+
import resolvers from './resolvers'
88
import defaultPlaygroundQuery from './initQuery'
99

10-
const { JWT_SECRET } = process.env;
10+
const { JWT_SECRET } = process.env
1111

12-
const pubsub = new PubSub();
12+
const pubsub = new PubSub()
1313
const server = new GraphQLServer({
1414
typeDefs: './src/schema.graphql',
1515
resolvers,
16-
context: req => ({
16+
context: (req) => ({
1717
...req,
1818
jwtSecret: JWT_SECRET,
1919
faker,
20-
pubsub
21-
})
22-
});
20+
pubsub,
21+
}),
22+
})
2323

24-
server.express.disable('x-powered-by');
24+
server.express.disable('x-powered-by')
2525

2626
server.express.use(
2727
'/graphql',
2828
jwt({
2929
secret: JWT_SECRET,
30-
credentialsRequired: false
31-
})
32-
);
30+
credentialsRequired: false,
31+
}),
32+
)
3333

34-
server.express.use(compression());
34+
server.express.use(compression())
3535

3636
const options = {
3737
formatError,
3838
endpoint: '/graphql',
3939
subscriptions: '/subscriptions',
4040
playground: '/',
41-
defaultPlaygroundQuery
42-
};
41+
defaultPlaygroundQuery,
42+
}
4343

4444
server.start(options, ({ port }) =>
45-
console.log(`Server is running on PORT: ${port}`)
46-
);
45+
console.log(`Server is running on PORT: ${port}`),
46+
)

src/initQuery.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ export default `# Welcome to FakerQL!
99
#
1010
# No queries/mutations are logged.
1111
#
12-
# GraphQL endpoint is ${window.location.origin}/graphql
12+
# GraphQL endpoint is /graphql
1313
#
1414
# This application is a fork of the opensource fakerql project
1515
# https://github.com/notrab/fakerql
1616
#
17-
#
1817
`

0 commit comments

Comments
 (0)