Skip to content

Commit c69da0e

Browse files
author
Johnwook Choi
committed
replace typeDefs
1 parent 471db71 commit c69da0e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

schema.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { importSchema } from "graphql-import";
12
import { makeExecutableSchema } from "graphql-tools";
23

34
// Some fake data
@@ -12,11 +13,7 @@ const books = [
1213
}
1314
];
1415

15-
// The GraphQL schema in string form
16-
const typeDefs = `
17-
type Query { books: [Book] }
18-
type Book { title: String, author: String }
19-
`;
16+
const typeDefs = importSchema("typeDefs/schema.graphql");
2017

2118
// The resolvers
2219
const resolvers = {

0 commit comments

Comments
 (0)