-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.todo
42 lines (35 loc) · 1.01 KB
/
.todo
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
Add context function for attributes
Add context function for models
Add context function for schema
- Goal is to have every part of the system be configurable by context
Create Visibility-Type: ENABLED, DISABLED & REQUIRED
Add config option to Attributes which enables or disables attributes by context.
```
model.attr('somevalue', GraphQLString)
.context(context => this.config({
create: REQUIRED, // is required during creation
update: DISABLED, // cannot be set during updates
where: DISABLED, // will not be used in where & filter input
order: ENABLED, // can be ordered by
…
}))
```
Add config option to Models which enables or disabled model functionalities.
```
model.context(context => {
this.config({
findMany: DISABLED,
findOne: ENABLED,
findOneArgs: {
where: ENABLED, // default is REQUIRED (needed for User.findOne-by AuthToken)
order: DISABLED,
}
create: DISABLED,
update: ENABLED,
updateArgs: {
…
},
delete: DISABLED,
})
})
```