-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathindex.ts
31 lines (30 loc) · 921 Bytes
/
index.ts
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
import * as casual from 'casual';
import { MockList } from 'apollo-server';
const numFormat = '########';
export default {
Int: () => casual.integer(0),
PeopleType: () => ({
name: casual.first_name + ' ' + casual.last_name,
mass: casual.numerify(numFormat),
hair_color: casual.safe_color_name,
skin_color: casual.safe_color_name,
eye_color: casual.safe_color_name,
birth_year: casual.year,
gender: casual.random_element(['male', 'female']),
homeworld: casual.url,
films: casual.array_of_words(10),
species: casual.array_of_words(10),
vehicles: casual.array_of_words(10),
starships: casual.array_of_words(10),
created: casual.date('YYYY-MM-DD'),
edited: casual.date('YYYY-MM-DD'),
url: casual.url
}),
ExampleType: () => ({
id: casual.integer(0),
name: casual.title
}),
RootQueryType: () => ({
examplesMock: () => new MockList(4)
})
};