@smartive/graphql-magic 22.3.0-next.1 → 22.3.0
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/.github/workflows/docs.yml +3 -3
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/testing.yml +6 -2
- package/.nvmrc +1 -1
- package/CHANGELOG.md +3 -2
- package/dist/bin/gqm.cjs +33 -190
- package/dist/cjs/index.cjs +39 -190
- package/dist/esm/migrations/generate.d.ts +0 -4
- package/dist/esm/migrations/generate.js +35 -180
- package/dist/esm/migrations/generate.js.map +1 -1
- package/dist/esm/models/model-definitions.d.ts +0 -1
- package/dist/esm/permissions/check.js +3 -0
- package/dist/esm/permissions/check.js.map +1 -1
- package/dist/esm/resolvers/resolver.js +3 -0
- package/dist/esm/resolvers/resolver.js.map +1 -1
- package/docker-compose.yml +1 -2
- package/eslint.config.mjs +54 -51
- package/package.json +7 -8
- package/src/migrations/generate.ts +35 -220
- package/src/models/model-definitions.ts +0 -1
- package/src/permissions/check.ts +3 -0
- package/src/resolvers/resolver.ts +3 -0
- package/tests/api/__snapshots__/delete.spec.ts.snap +1 -1
- package/tests/api/__snapshots__/inheritance.spec.ts.snap +1 -1
- package/tests/api/__snapshots__/query.spec.ts.snap +1 -1
- package/tests/generated/client/index.ts +22 -33
- package/tests/unit/__snapshots__/resolve.spec.ts.snap +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartive/graphql-magic",
|
|
3
|
-
"version": "22.3.0
|
|
3
|
+
"version": "22.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@graphql-codegen/typescript": "^4.0.1",
|
|
46
46
|
"@graphql-codegen/typescript-operations": "^4.0.1",
|
|
47
47
|
"@graphql-codegen/typescript-resolvers": "^4.0.1",
|
|
48
|
-
"@types/node": "^
|
|
48
|
+
"@types/node": "^24.0.0",
|
|
49
49
|
"code-block-writer": "^13.0.0",
|
|
50
|
-
"commander": "^
|
|
50
|
+
"commander": "^14.0.0",
|
|
51
51
|
"dayjs": "^1.11.10",
|
|
52
52
|
"dotenv": "^16.3.1",
|
|
53
53
|
"graphql": "^16.0.0",
|
|
@@ -64,19 +64,18 @@
|
|
|
64
64
|
"knex": "^3.0.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@smartive/eslint-config": "
|
|
67
|
+
"@smartive/eslint-config": "7.0.0",
|
|
68
68
|
"@smartive/prettier-config": "3.1.2",
|
|
69
|
-
"@types/jest": "
|
|
69
|
+
"@types/jest": "30.0.0",
|
|
70
70
|
"@types/lodash": "4.17.21",
|
|
71
71
|
"@types/luxon": "3.7.1",
|
|
72
72
|
"@types/pg": "8.15.6",
|
|
73
|
-
"@types/uuid": "10.0.0",
|
|
74
73
|
"conventional-changelog-conventionalcommits": "9.1.0",
|
|
75
74
|
"create-ts-index": "1.14.0",
|
|
76
|
-
"del-cli": "
|
|
75
|
+
"del-cli": "7.0.0",
|
|
77
76
|
"esbuild": "0.27.0",
|
|
78
77
|
"eslint": "9.39.1",
|
|
79
|
-
"jest": "
|
|
78
|
+
"jest": "30.2.0",
|
|
80
79
|
"mock-knex": "0.4.13",
|
|
81
80
|
"prettier": "3.7.3",
|
|
82
81
|
"ts-jest": "29.4.6",
|
|
@@ -160,27 +160,35 @@ export class MigrationGenerator {
|
|
|
160
160
|
);
|
|
161
161
|
|
|
162
162
|
// Update fields
|
|
163
|
-
const
|
|
164
|
-
if (!field.generateAs) {
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
|
|
163
|
+
const existingFields = model.fields.filter((field) => {
|
|
168
164
|
const col = this.getColumn(model.name, field.kind === 'relation' ? `${field.name}Id` : field.name);
|
|
169
165
|
if (!col) {
|
|
170
166
|
return false;
|
|
171
167
|
}
|
|
172
168
|
|
|
173
|
-
if (col.
|
|
169
|
+
if ((!field.nonNull && !col.is_nullable) || (field.nonNull && col.is_nullable)) {
|
|
174
170
|
return true;
|
|
175
171
|
}
|
|
176
172
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
173
|
+
if (!field.kind || field.kind === 'primitive') {
|
|
174
|
+
if (field.type === 'Int') {
|
|
175
|
+
if (col.data_type !== 'integer') {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (field.type === 'Float') {
|
|
180
|
+
if (field.double) {
|
|
181
|
+
if (col.data_type !== 'double precision') {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
} else if (col.data_type !== 'numeric') {
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
182
189
|
|
|
183
|
-
|
|
190
|
+
return false;
|
|
191
|
+
});
|
|
184
192
|
this.updateFields(model, existingFields, up, down);
|
|
185
193
|
}
|
|
186
194
|
|
|
@@ -367,10 +375,6 @@ export class MigrationGenerator {
|
|
|
367
375
|
for (const field of fields) {
|
|
368
376
|
alter.push(() => this.column(field, { setNonNull: field.defaultValue !== undefined }));
|
|
369
377
|
|
|
370
|
-
if (field.generateAs) {
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
378
|
// If the field is not nullable but has no default, write placeholder code
|
|
375
379
|
if (field.nonNull && field.defaultValue === undefined) {
|
|
376
380
|
updates.push(() => this.writer.write(`${field.name}: 'TODO',`).newLine());
|
|
@@ -401,63 +405,13 @@ export class MigrationGenerator {
|
|
|
401
405
|
|
|
402
406
|
down.push(() => {
|
|
403
407
|
this.alterTable(model.name, () => {
|
|
404
|
-
for (const { kind, name } of fields
|
|
408
|
+
for (const { kind, name } of fields) {
|
|
405
409
|
this.dropColumn(kind === 'relation' ? `${name}Id` : name);
|
|
406
410
|
}
|
|
407
411
|
});
|
|
408
412
|
});
|
|
409
413
|
}
|
|
410
414
|
|
|
411
|
-
private updateFieldsRaw(model: EntityModel, fields: EntityField[], up: Callbacks, down: Callbacks) {
|
|
412
|
-
if (!fields.length) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
up.push(() => {
|
|
417
|
-
this.alterTableRaw(model.name, () => {
|
|
418
|
-
for (const [index, field] of fields.entries()) {
|
|
419
|
-
this.columnRaw(field, { alter: true }, index);
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
down.push(() => {
|
|
425
|
-
this.alterTableRaw(model.name, () => {
|
|
426
|
-
for (const [index, field] of fields.entries()) {
|
|
427
|
-
this.columnRaw(field, { alter: true }, index);
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
if (isUpdatableModel(model)) {
|
|
433
|
-
const updatableFields = fields.filter(isUpdatableField);
|
|
434
|
-
if (!updatableFields.length) {
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
up.push(() => {
|
|
439
|
-
this.alterTable(`${model.name}Revision`, () => {
|
|
440
|
-
for (const [index, field] of updatableFields.entries()) {
|
|
441
|
-
this.columnRaw(field, { alter: true }, index);
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
down.push(() => {
|
|
447
|
-
this.alterTable(`${model.name}Revision`, () => {
|
|
448
|
-
for (const [index, field] of updatableFields.entries()) {
|
|
449
|
-
this.columnRaw(
|
|
450
|
-
field,
|
|
451
|
-
{ alter: true },
|
|
452
|
-
index,
|
|
453
|
-
summonByName(this.columns[model.name], field.kind === 'relation' ? `${field.name}Id` : field.name),
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
415
|
private updateFields(model: EntityModel, fields: EntityField[], up: Callbacks, down: Callbacks) {
|
|
462
416
|
if (!fields.length) {
|
|
463
417
|
return;
|
|
@@ -618,12 +572,6 @@ export class MigrationGenerator {
|
|
|
618
572
|
.blankLine();
|
|
619
573
|
}
|
|
620
574
|
|
|
621
|
-
private alterTableRaw(table: string, block: () => void) {
|
|
622
|
-
this.writer.write(`await knex.raw('ALTER TABLE "${table}"`);
|
|
623
|
-
block();
|
|
624
|
-
this.writer.write(`');`).newLine().blankLine();
|
|
625
|
-
}
|
|
626
|
-
|
|
627
575
|
private alterTable(table: string, block: () => void) {
|
|
628
576
|
return this.writer
|
|
629
577
|
.write(`await knex.schema.alterTable('${table}', (table) => `)
|
|
@@ -657,125 +605,29 @@ export class MigrationGenerator {
|
|
|
657
605
|
return value;
|
|
658
606
|
}
|
|
659
607
|
|
|
660
|
-
private columnRaw(
|
|
661
|
-
{ name, ...field }: EntityField,
|
|
662
|
-
{ setNonNull = true, alter = false } = {},
|
|
663
|
-
index: number,
|
|
664
|
-
toColumn?: Column,
|
|
665
|
-
) {
|
|
666
|
-
const nonNull = () => {
|
|
667
|
-
if (setNonNull) {
|
|
668
|
-
if (toColumn) {
|
|
669
|
-
if (toColumn.is_nullable) {
|
|
670
|
-
return false;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
return true;
|
|
674
|
-
}
|
|
675
|
-
if (field.nonNull) {
|
|
676
|
-
return true;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
return false;
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
const kind = field.kind;
|
|
683
|
-
if (field.generateAs) {
|
|
684
|
-
let type = '';
|
|
685
|
-
switch (kind) {
|
|
686
|
-
case undefined:
|
|
687
|
-
case 'primitive':
|
|
688
|
-
switch (field.type) {
|
|
689
|
-
case 'Float':
|
|
690
|
-
type = `decimal(${field.precision ?? 'undefined'}, ${field.scale ?? 'undefined'})`;
|
|
691
|
-
break;
|
|
692
|
-
default:
|
|
693
|
-
throw new Error(`Generated columns of kind ${kind} and type ${field.type} are not supported yet.`);
|
|
694
|
-
}
|
|
695
|
-
break;
|
|
696
|
-
default:
|
|
697
|
-
throw new Error(`Generated columns of kind ${kind} are not supported yet.`);
|
|
698
|
-
}
|
|
699
|
-
if (index) {
|
|
700
|
-
this.writer.write(`,`);
|
|
701
|
-
}
|
|
702
|
-
if (alter) {
|
|
703
|
-
this.writer.write(` ALTER COLUMN "${name}" TYPE ${type}`);
|
|
704
|
-
if (setNonNull) {
|
|
705
|
-
if (nonNull()) {
|
|
706
|
-
this.writer.write(`, ALTER COLUMN "${name}" SET NOT NULL`);
|
|
707
|
-
} else {
|
|
708
|
-
this.writer.write(`, ALTER COLUMN "${name}" DROP NOT NULL`);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
this.writer.write(`, ALTER COLUMN "${name}" SET EXPRESSION AS (${field.generateAs})`);
|
|
712
|
-
} else {
|
|
713
|
-
this.writer.write(
|
|
714
|
-
`${alter ? 'ALTER' : 'ADD'} COLUMN "${name}" ${type}${nonNull() ? ' not null' : ''} GENERATED ALWAYS AS (${field.generateAs}) STORED`,
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
throw new Error(`Only generated columns can be created with columnRaw`);
|
|
722
|
-
}
|
|
723
|
-
|
|
724
608
|
private column(
|
|
725
609
|
{ name, primary, list, ...field }: EntityField,
|
|
726
610
|
{ setUnique = true, setNonNull = true, alter = false, foreign = true, setDefault = true } = {},
|
|
727
611
|
toColumn?: Column,
|
|
728
612
|
) {
|
|
729
|
-
const nonNull = () => {
|
|
730
|
-
if (setNonNull) {
|
|
731
|
-
if (toColumn) {
|
|
732
|
-
if (toColumn.is_nullable) {
|
|
733
|
-
return false;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
return true;
|
|
737
|
-
}
|
|
738
|
-
if (field.nonNull) {
|
|
739
|
-
return true;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
return false;
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
const kind = field.kind;
|
|
746
|
-
if (field.generateAs) {
|
|
747
|
-
let type = '';
|
|
748
|
-
switch (kind) {
|
|
749
|
-
case undefined:
|
|
750
|
-
case 'primitive':
|
|
751
|
-
switch (field.type) {
|
|
752
|
-
case 'Float':
|
|
753
|
-
type = `decimal(${field.precision ?? 'undefined'}, ${field.scale ?? 'undefined'})`;
|
|
754
|
-
break;
|
|
755
|
-
default:
|
|
756
|
-
throw new Error(`Generated columns of kind ${kind} and type ${field.type} are not supported yet.`);
|
|
757
|
-
}
|
|
758
|
-
break;
|
|
759
|
-
default:
|
|
760
|
-
throw new Error(`Generated columns of kind ${kind} are not supported yet.`);
|
|
761
|
-
}
|
|
762
|
-
this.writer.write(
|
|
763
|
-
`table.specificType('${name}', '${type}${nonNull() ? ' not null' : ''} GENERATED ALWAYS AS (${field.generateAs}) STORED')`,
|
|
764
|
-
);
|
|
765
|
-
if (alter) {
|
|
766
|
-
this.writer.write('.alter()');
|
|
767
|
-
}
|
|
768
|
-
this.writer.write(';').newLine();
|
|
769
|
-
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
|
|
773
613
|
const col = (what?: string) => {
|
|
774
614
|
if (what) {
|
|
775
615
|
this.writer.write(what);
|
|
776
616
|
}
|
|
777
617
|
if (setNonNull) {
|
|
778
|
-
|
|
618
|
+
if (toColumn) {
|
|
619
|
+
if (toColumn.is_nullable) {
|
|
620
|
+
this.writer.write(`.nullable()`);
|
|
621
|
+
} else {
|
|
622
|
+
this.writer.write('.notNullable()');
|
|
623
|
+
}
|
|
624
|
+
} else {
|
|
625
|
+
if (field.nonNull) {
|
|
626
|
+
this.writer.write(`.notNullable()`);
|
|
627
|
+
} else {
|
|
628
|
+
this.writer.write('.nullable()');
|
|
629
|
+
}
|
|
630
|
+
}
|
|
779
631
|
}
|
|
780
632
|
if (setDefault && field.defaultValue !== undefined) {
|
|
781
633
|
this.writer.write(`.defaultTo(${this.value(field.defaultValue)})`);
|
|
@@ -790,6 +642,7 @@ export class MigrationGenerator {
|
|
|
790
642
|
}
|
|
791
643
|
this.writer.write(';').newLine();
|
|
792
644
|
};
|
|
645
|
+
const kind = field.kind;
|
|
793
646
|
switch (kind) {
|
|
794
647
|
case undefined:
|
|
795
648
|
case 'primitive':
|
|
@@ -863,44 +716,6 @@ export class MigrationGenerator {
|
|
|
863
716
|
private getColumn(tableName: string, columnName: string) {
|
|
864
717
|
return this.columns[tableName].find((col) => col.name === columnName);
|
|
865
718
|
}
|
|
866
|
-
|
|
867
|
-
private hasChanged(model: EntityModel, field: EntityField) {
|
|
868
|
-
const col = this.getColumn(model.name, field.kind === 'relation' ? `${field.name}Id` : field.name);
|
|
869
|
-
if (!col) {
|
|
870
|
-
return false;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
if (field.generateAs) {
|
|
874
|
-
if (col.generation_expression !== field.generateAs) {
|
|
875
|
-
throw new Error(
|
|
876
|
-
`Column ${col.name} has specific type ${col.generation_expression} but expected ${field.generateAs}`,
|
|
877
|
-
);
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
if ((!field.nonNull && !col.is_nullable) || (field.nonNull && col.is_nullable)) {
|
|
882
|
-
return true;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
if (!field.kind || field.kind === 'primitive') {
|
|
886
|
-
if (field.type === 'Int') {
|
|
887
|
-
if (col.data_type !== 'integer') {
|
|
888
|
-
return true;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
if (field.type === 'Float') {
|
|
892
|
-
if (field.double) {
|
|
893
|
-
if (col.data_type !== 'double precision') {
|
|
894
|
-
return true;
|
|
895
|
-
}
|
|
896
|
-
} else if (col.data_type !== 'numeric') {
|
|
897
|
-
return true;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
return false;
|
|
903
|
-
}
|
|
904
719
|
}
|
|
905
720
|
|
|
906
721
|
export const getMigrationDate = () => {
|
package/src/permissions/check.ts
CHANGED
|
@@ -207,6 +207,9 @@ export const checkCanWrite = async (
|
|
|
207
207
|
|
|
208
208
|
const role = getRole(ctx);
|
|
209
209
|
if (linked) {
|
|
210
|
+
if (process.env.DEBUG_GRAPHQL_MAGIC === 'true') {
|
|
211
|
+
console.debug('QUERY', query.toString());
|
|
212
|
+
}
|
|
210
213
|
const canMutate = await query;
|
|
211
214
|
if (!canMutate) {
|
|
212
215
|
throw new PermissionError(role, action, `this ${model.name}`, 'no linkable entities');
|
|
@@ -55,6 +55,9 @@ export const resolve = async (ctx: FullContext, id?: string) => {
|
|
|
55
55
|
void query.limit(1);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
if (process.env.DEBUG_GRAPHQL_MAGIC === 'true') {
|
|
59
|
+
console.debug('QUERY', query.toString());
|
|
60
|
+
}
|
|
58
61
|
const raw = await query;
|
|
59
62
|
|
|
60
63
|
const res = hydrate(node, raw);
|
|
@@ -17,7 +17,6 @@ export type Scalars = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export type AnotherObject = {
|
|
20
|
-
__typename: 'AnotherObject';
|
|
21
20
|
deleteRootId: Maybe<Scalars['ID']['output']>;
|
|
22
21
|
deleteRootType: Maybe<Scalars['String']['output']>;
|
|
23
22
|
deleted: Scalars['Boolean']['output'];
|
|
@@ -67,7 +66,6 @@ export type AnotherObjectWhereUnique = {
|
|
|
67
66
|
};
|
|
68
67
|
|
|
69
68
|
export type Answer = Reaction & {
|
|
70
|
-
__typename: 'Answer';
|
|
71
69
|
childAnswers: Array<Answer>;
|
|
72
70
|
childQuestions: Array<Question>;
|
|
73
71
|
childReactions: Array<Reaction>;
|
|
@@ -157,17 +155,14 @@ export type CreateSomeObject = {
|
|
|
157
155
|
};
|
|
158
156
|
|
|
159
157
|
export type Duck = {
|
|
160
|
-
__typename: 'Duck';
|
|
161
158
|
name: Maybe<Scalars['String']['output']>;
|
|
162
159
|
};
|
|
163
160
|
|
|
164
161
|
export type Eagle = {
|
|
165
|
-
__typename: 'Eagle';
|
|
166
162
|
name: Maybe<Scalars['String']['output']>;
|
|
167
163
|
};
|
|
168
164
|
|
|
169
165
|
export type Mutation = {
|
|
170
|
-
__typename: 'Mutation';
|
|
171
166
|
createAnswer: Answer;
|
|
172
167
|
createQuestion: Question;
|
|
173
168
|
createReview: Review;
|
|
@@ -293,7 +288,6 @@ export enum Order {
|
|
|
293
288
|
}
|
|
294
289
|
|
|
295
290
|
export type Query = {
|
|
296
|
-
__typename: 'Query';
|
|
297
291
|
anotherObjects: Array<AnotherObject>;
|
|
298
292
|
answer: Answer;
|
|
299
293
|
answers: Array<Answer>;
|
|
@@ -384,7 +378,6 @@ export type QuerysomeObjectArgs = {
|
|
|
384
378
|
};
|
|
385
379
|
|
|
386
380
|
export type Question = Reaction & {
|
|
387
|
-
__typename: 'Question';
|
|
388
381
|
childAnswers: Array<Answer>;
|
|
389
382
|
childQuestions: Array<Question>;
|
|
390
383
|
childReactions: Array<Reaction>;
|
|
@@ -531,7 +524,6 @@ export type ReactionWhereUnique = {
|
|
|
531
524
|
};
|
|
532
525
|
|
|
533
526
|
export type Review = Reaction & {
|
|
534
|
-
__typename: 'Review';
|
|
535
527
|
childAnswers: Array<Answer>;
|
|
536
528
|
childQuestions: Array<Question>;
|
|
537
529
|
childReactions: Array<Reaction>;
|
|
@@ -618,7 +610,6 @@ export enum SomeEnum {
|
|
|
618
610
|
}
|
|
619
611
|
|
|
620
612
|
export type SomeObject = {
|
|
621
|
-
__typename: 'SomeObject';
|
|
622
613
|
another: Maybe<AnotherObject>;
|
|
623
614
|
createdAt: Scalars['DateTime']['output'];
|
|
624
615
|
createdBy: User;
|
|
@@ -665,7 +656,6 @@ export type SomeObjectWhereUnique = {
|
|
|
665
656
|
};
|
|
666
657
|
|
|
667
658
|
export type SomeRawObject = {
|
|
668
|
-
__typename: 'SomeRawObject';
|
|
669
659
|
field: Maybe<Scalars['String']['output']>;
|
|
670
660
|
};
|
|
671
661
|
|
|
@@ -688,7 +678,6 @@ export type UpdateSomeObject = {
|
|
|
688
678
|
};
|
|
689
679
|
|
|
690
680
|
export type User = {
|
|
691
|
-
__typename: 'User';
|
|
692
681
|
createdAnswers: Array<Answer>;
|
|
693
682
|
createdManyObjects: Array<SomeObject>;
|
|
694
683
|
createdQuestions: Array<Question>;
|
|
@@ -860,34 +849,34 @@ export type DeleteAnotherObjectMutation = { deleteAnotherObject: string };
|
|
|
860
849
|
export type GetAnotherObjectQueryVariables = Exact<{ [key: string]: never; }>;
|
|
861
850
|
|
|
862
851
|
|
|
863
|
-
export type GetAnotherObjectQuery = { anotherObjects: Array<{
|
|
852
|
+
export type GetAnotherObjectQuery = { anotherObjects: Array<{ id: string, deleted: boolean }> };
|
|
864
853
|
|
|
865
854
|
export type GetReactionsQueryVariables = Exact<{ [key: string]: never; }>;
|
|
866
855
|
|
|
867
856
|
|
|
868
|
-
export type GetReactionsQuery = { reactions: Array<{
|
|
857
|
+
export type GetReactionsQuery = { reactions: Array<{ type: ReactionType, content: string | null } | { type: ReactionType, content: string | null } | { rating: number | null, type: ReactionType, content: string | null }> };
|
|
869
858
|
|
|
870
859
|
export type GetReactionQueryVariables = Exact<{ [key: string]: never; }>;
|
|
871
860
|
|
|
872
861
|
|
|
873
|
-
export type GetReactionQuery = { reaction: {
|
|
862
|
+
export type GetReactionQuery = { reaction: { type: ReactionType, content: string | null } | { type: ReactionType, content: string | null } | { rating: number | null, type: ReactionType, content: string | null } };
|
|
874
863
|
|
|
875
864
|
export type GetReviewsQueryVariables = Exact<{ [key: string]: never; }>;
|
|
876
865
|
|
|
877
866
|
|
|
878
|
-
export type GetReviewsQuery = { reviews: Array<{
|
|
867
|
+
export type GetReviewsQuery = { reviews: Array<{ type: ReactionType, content: string | null, rating: number | null }> };
|
|
879
868
|
|
|
880
869
|
export type GetReviewQueryVariables = Exact<{ [key: string]: never; }>;
|
|
881
870
|
|
|
882
871
|
|
|
883
|
-
export type GetReviewQuery = { review: {
|
|
872
|
+
export type GetReviewQuery = { review: { type: ReactionType, content: string | null, rating: number | null } };
|
|
884
873
|
|
|
885
874
|
export type CreateReviewMutationVariables = Exact<{
|
|
886
875
|
data: CreateReview;
|
|
887
876
|
}>;
|
|
888
877
|
|
|
889
878
|
|
|
890
|
-
export type CreateReviewMutation = { createReview: {
|
|
879
|
+
export type CreateReviewMutation = { createReview: { content: string | null, rating: number | null } };
|
|
891
880
|
|
|
892
881
|
export type UpdateReviewMutationVariables = Exact<{
|
|
893
882
|
id: Scalars['ID']['input'];
|
|
@@ -895,42 +884,42 @@ export type UpdateReviewMutationVariables = Exact<{
|
|
|
895
884
|
}>;
|
|
896
885
|
|
|
897
886
|
|
|
898
|
-
export type UpdateReviewMutation = { updateReview: {
|
|
887
|
+
export type UpdateReviewMutation = { updateReview: { content: string | null, rating: number | null } };
|
|
899
888
|
|
|
900
889
|
export type SomeQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
901
890
|
|
|
902
891
|
|
|
903
|
-
export type SomeQueryQuery = { manyObjects: Array<{
|
|
892
|
+
export type SomeQueryQuery = { manyObjects: Array<{ id: string, field: string | null, xyz: number, another: { id: string, manyObjects: Array<{ id: string, field: string | null }> } | null }> };
|
|
904
893
|
|
|
905
894
|
export type ReverseFiltersQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
906
895
|
|
|
907
896
|
|
|
908
|
-
export type ReverseFiltersQueryQuery = { all: Array<{
|
|
897
|
+
export type ReverseFiltersQueryQuery = { all: Array<{ id: string, manyObjects: Array<{ float: number }> }>, withFloat0: Array<{ id: string, manyObjects: Array<{ float: number }> }>, withFloat0_5: Array<{ id: string, manyObjects: Array<{ float: number }> }>, noneFloat0: Array<{ id: string, manyObjects: Array<{ float: number }> }>, noneFloat0_5: Array<{ id: string, manyObjects: Array<{ float: number }> }>, noneFloat2: Array<{ id: string, manyObjects: Array<{ float: number }> }> };
|
|
909
898
|
|
|
910
899
|
export type NotQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
911
900
|
|
|
912
901
|
|
|
913
|
-
export type NotQueryQuery = { manyObjects: Array<{
|
|
902
|
+
export type NotQueryQuery = { manyObjects: Array<{ id: string }> };
|
|
914
903
|
|
|
915
904
|
export type AndQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
916
905
|
|
|
917
906
|
|
|
918
|
-
export type AndQueryQuery = { manyObjects: Array<{
|
|
907
|
+
export type AndQueryQuery = { manyObjects: Array<{ id: string }> };
|
|
919
908
|
|
|
920
909
|
export type OrQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
921
910
|
|
|
922
911
|
|
|
923
|
-
export type OrQueryQuery = { manyObjects: Array<{
|
|
912
|
+
export type OrQueryQuery = { manyObjects: Array<{ id: string }> };
|
|
924
913
|
|
|
925
914
|
export type NullFilterQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
926
915
|
|
|
927
916
|
|
|
928
|
-
export type NullFilterQueryQuery = { all: Array<{
|
|
917
|
+
export type NullFilterQueryQuery = { all: Array<{ id: string, field: string | null }>, withNullField: Array<{ id: string, field: string | null }>, withNotNullField: Array<{ id: string, field: string | null }>, withSpecificField: Array<{ id: string, field: string | null }>, withComplexFilter: Array<{ id: string, field: string | null }>, withNestedFilter: Array<{ id: string, field: string | null, another: { manyObjects: Array<{ id: string, field: string | null }> } | null }> };
|
|
929
918
|
|
|
930
919
|
export type NullRelationFilterQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
931
920
|
|
|
932
921
|
|
|
933
|
-
export type NullRelationFilterQueryQuery = { all: Array<{
|
|
922
|
+
export type NullRelationFilterQueryQuery = { all: Array<{ id: string, another: { id: string } | null }>, withNullAnother: Array<{ id: string, another: { id: string } | null }>, withNotNullAnother: Array<{ id: string, another: { id: string } | null }> };
|
|
934
923
|
|
|
935
924
|
export type DeleteAnotherObjectMutationMutationVariables = Exact<{
|
|
936
925
|
id: Scalars['ID']['input'];
|
|
@@ -951,7 +940,7 @@ export type CreateSomeObjectMutationMutationVariables = Exact<{
|
|
|
951
940
|
}>;
|
|
952
941
|
|
|
953
942
|
|
|
954
|
-
export type CreateSomeObjectMutationMutation = { createSomeObject: {
|
|
943
|
+
export type CreateSomeObjectMutationMutation = { createSomeObject: { id: string } };
|
|
955
944
|
|
|
956
945
|
export type UpdateSomeObjectMutationMutationVariables = Exact<{
|
|
957
946
|
id: Scalars['ID']['input'];
|
|
@@ -959,7 +948,7 @@ export type UpdateSomeObjectMutationMutationVariables = Exact<{
|
|
|
959
948
|
}>;
|
|
960
949
|
|
|
961
950
|
|
|
962
|
-
export type UpdateSomeObjectMutationMutation = { updateSomeObject: {
|
|
951
|
+
export type UpdateSomeObjectMutationMutation = { updateSomeObject: { id: string } };
|
|
963
952
|
|
|
964
953
|
export type DeleteSomeObjectMutationMutationVariables = Exact<{
|
|
965
954
|
id: Scalars['ID']['input'];
|
|
@@ -980,7 +969,7 @@ export type CreateReviewMutationMutationVariables = Exact<{
|
|
|
980
969
|
}>;
|
|
981
970
|
|
|
982
971
|
|
|
983
|
-
export type CreateReviewMutationMutation = { createReview: {
|
|
972
|
+
export type CreateReviewMutationMutation = { createReview: { id: string } };
|
|
984
973
|
|
|
985
974
|
export type UpdateReviewMutationMutationVariables = Exact<{
|
|
986
975
|
id: Scalars['ID']['input'];
|
|
@@ -988,7 +977,7 @@ export type UpdateReviewMutationMutationVariables = Exact<{
|
|
|
988
977
|
}>;
|
|
989
978
|
|
|
990
979
|
|
|
991
|
-
export type UpdateReviewMutationMutation = { updateReview: {
|
|
980
|
+
export type UpdateReviewMutationMutation = { updateReview: { id: string } };
|
|
992
981
|
|
|
993
982
|
export type DeleteReviewMutationMutationVariables = Exact<{
|
|
994
983
|
id: Scalars['ID']['input'];
|
|
@@ -1009,7 +998,7 @@ export type CreateQuestionMutationMutationVariables = Exact<{
|
|
|
1009
998
|
}>;
|
|
1010
999
|
|
|
1011
1000
|
|
|
1012
|
-
export type CreateQuestionMutationMutation = { createQuestion: {
|
|
1001
|
+
export type CreateQuestionMutationMutation = { createQuestion: { id: string } };
|
|
1013
1002
|
|
|
1014
1003
|
export type UpdateQuestionMutationMutationVariables = Exact<{
|
|
1015
1004
|
id: Scalars['ID']['input'];
|
|
@@ -1017,7 +1006,7 @@ export type UpdateQuestionMutationMutationVariables = Exact<{
|
|
|
1017
1006
|
}>;
|
|
1018
1007
|
|
|
1019
1008
|
|
|
1020
|
-
export type UpdateQuestionMutationMutation = { updateQuestion: {
|
|
1009
|
+
export type UpdateQuestionMutationMutation = { updateQuestion: { id: string } };
|
|
1021
1010
|
|
|
1022
1011
|
export type DeleteQuestionMutationMutationVariables = Exact<{
|
|
1023
1012
|
id: Scalars['ID']['input'];
|
|
@@ -1038,7 +1027,7 @@ export type CreateAnswerMutationMutationVariables = Exact<{
|
|
|
1038
1027
|
}>;
|
|
1039
1028
|
|
|
1040
1029
|
|
|
1041
|
-
export type CreateAnswerMutationMutation = { createAnswer: {
|
|
1030
|
+
export type CreateAnswerMutationMutation = { createAnswer: { id: string } };
|
|
1042
1031
|
|
|
1043
1032
|
export type UpdateAnswerMutationMutationVariables = Exact<{
|
|
1044
1033
|
id: Scalars['ID']['input'];
|
|
@@ -1046,7 +1035,7 @@ export type UpdateAnswerMutationMutationVariables = Exact<{
|
|
|
1046
1035
|
}>;
|
|
1047
1036
|
|
|
1048
1037
|
|
|
1049
|
-
export type UpdateAnswerMutationMutation = { updateAnswer: {
|
|
1038
|
+
export type UpdateAnswerMutationMutation = { updateAnswer: { id: string } };
|
|
1050
1039
|
|
|
1051
1040
|
export type DeleteAnswerMutationMutationVariables = Exact<{
|
|
1052
1041
|
id: Scalars['ID']['input'];
|