mirror of
https://github.com/seigler/graphql-playground
synced 2025-07-27 01:26:10 +00:00
feat(server): enable graphiql
This commit is contained in:
parent
27a5900978
commit
c401dfbe04
2 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,8 @@ const schema = require('./schema/schema');
|
|||
const app = express();
|
||||
|
||||
app.use('/graphql', graphqlHTTP({
|
||||
schema
|
||||
schema,
|
||||
graphiql: true
|
||||
}));
|
||||
|
||||
app.listen(4000, () => {
|
||||
|
|
|
@ -28,7 +28,7 @@ const RootQuery = new GraphQLObjectType({
|
|||
fields: {
|
||||
book: {
|
||||
type: BookType,
|
||||
args: { id: { GraphQLString } },
|
||||
args: { id: { type: GraphQLString } },
|
||||
resolve (parent, { id }) {
|
||||
return _.find(books, { id });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue