@simtlix/simfinity-js 2.4.1 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simtlix/simfinity-js",
3
- "version": "2.4.1",
3
+ "version": "2.4.4",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/auth/index.js CHANGED
@@ -16,19 +16,19 @@
16
16
  *
17
17
  * const permissions = {
18
18
  * Query: {
19
- * users: requireAuth(),
20
- * adminDashboard: requireRole('ADMIN')
19
+ * series: requireAuth(),
20
+ * seasons: requireAuth(),
21
21
  * },
22
22
  * Mutation: {
23
- * publishPost: requireRole('EDITOR')
23
+ * deleteserie: requireRole('admin'),
24
+ * deletestar: requireRole('admin'),
24
25
  * },
25
- * User: {
26
+ * serie: {
26
27
  * '*': requireAuth(),
27
- * email: requireRole('ADMIN')
28
28
  * }
29
29
  * };
30
30
  *
31
- * const authPlugin = createAuthPlugin(permissions, { defaultPolicy: 'DENY' });
31
+ * const authPlugin = createAuthPlugin(permissions, { defaultPolicy: 'ALLOW' });
32
32
  * const yoga = createYoga({ schema, plugins: [authPlugin] });
33
33
  */
34
34
 
package/src/index.js CHANGED
@@ -63,6 +63,7 @@ const FieldExtensionsType = new GraphQLObjectType({
63
63
  fields: () => ({
64
64
  relation: { type: RelationType },
65
65
  stateMachine: { type: GraphQLBoolean },
66
+ readOnly: { type: GraphQLBoolean },
66
67
  }),
67
68
  });
68
69
 
@@ -679,7 +680,10 @@ const onUpdateSubject = async (Model, gqltype, controller, args, session, linkTo
679
680
 
680
681
  if (args[fieldEntryName] === null
681
682
  && !(fieldEntry.type instanceof GraphQLNonNull)) {
682
- materializedModel.modelArgs = { ...materializedModel.modelArgs, $unset: { [fieldEntryName]: '' } };
683
+ materializedModel.modelArgs = {
684
+ ...materializedModel.modelArgs,
685
+ $unset: { ...materializedModel.modelArgs.$unset, [fieldEntryName]: '' },
686
+ };
683
687
  }
684
688
  });
685
689