-
Notifications
You must be signed in to change notification settings - Fork 48
/
lodash_idl.ts
108 lines (85 loc) · 2.49 KB
/
lodash_idl.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const lodashProps = `
map: Path
keyBy: Path
each: LodashOperations
# Creates an array of elements split into groups the length of size.
# If array can't be split evenly, the final chunk will be the remaining elements.
chunk: Int
# Creates a slice of array with n elements dropped from the beginning.
drop: Int
# Creates a slice of array with n elements dropped from the end.
dropRight: Int
# Creates a slice of array with n elements taken from the beginning.
take: Int
# Creates a slice of array with n elements taken from the end.
takeRight: Int
# Recursively flatten array up to depth times.
flattenDepth: Int
# The inverse of \`toPairs\`; this method returns an object composed from key-value
# pairs.
fromPairs: DummyArgument
# Gets the element at index n of array. If n is negative, the nth element from
# the end is returned.
nth: Int
# Reverses array so that the first element becomes the last, the second element
# becomes the second to last, and so on.
reverse: DummyArgument
# Creates a duplicate-free version of an array, in which only the first occurrence
# of each element is kept. The order of result values is determined by the order
# they occur in the array.
uniq: DummyArgument
uniqBy: Path
countBy: Path
filter: JSON
reject: JSON
filterIf: Predicate
rejectIf: Predicate
groupBy: Path
sortBy: [Path!]
minBy: Path
maxBy: Path
meanBy: Path
sumBy: Path
# Converts all elements in array into a string separated by separator.
join: String
get: Path
mapValues: Path
# Creates an array of values corresponding to paths of object.
at: [Path!]
# Creates an array of own enumerable string keyed-value pairs for object.
toPairs: DummyArgument
# Creates an object composed of the inverted keys and values of object.
# If object contains duplicate values, subsequent values overwrite property
# assignments of previous values.
invert: DummyArgument
invertBy: Path
# Creates an array of the own enumerable property names of object.
keys: DummyArgument
# Creates an array of the own enumerable string keyed property values of object.
values: DummyArgument
`;
export const lodashIDL = `
scalar Path
scalar JSON
enum DummyArgument {
none
}
input Predicate {
lt: JSON
lte: JSON
gt: JSON
gte: JSON
eq: JSON
startsWith: String
endsWith: String
and: [Predicate!]
or: [Predicate!]
${lodashProps}
}
directive @_(
${lodashProps}
) on FIELD | QUERY
input LodashOperations {
${lodashProps}
}
`;