-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.js
40 lines (35 loc) · 842 Bytes
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { makeExecutableSchema, addMockFunctionToSchema } from "graphql-tools";
import resolvers from './resolvers';
const typeDefs = `
scalar Date
type Owner {
user_id: ID!
reputation: Int
user_type: String
accept_rate: Int
profile_image: String
display_name: String
link: String
}
type Question {
question_id: ID!
tags: [String]
owner: Owner
is_answered: Boolean
view_count: Int
answer_count: Int
score: Int
last_activity_date: Date
creation_date: Date
link: String
title: String
}
type Query {
questions(tags: String!, limit: Int, sort: String, score: Int): [Question]
}
`;
const Schema = makeExecutableSchema({
typeDefs,
resolvers
});
export default Schema;