graphql-data-generator 0.4.3 → 0.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/esm/proxy.js +1 -1
- package/package.json +1 -1
- package/script/proxy.js +1 -1
- package/types/types.d.ts +4 -3
package/esm/proxy.js
CHANGED
|
@@ -711,7 +711,7 @@ export const operation = (definitions, scalars, query, ...patches) => {
|
|
|
711
711
|
? error
|
|
712
712
|
: Object.assign(new Error(), error);
|
|
713
713
|
}
|
|
714
|
-
else if (data !== undefined)
|
|
714
|
+
else if (data !== undefined && data !== null)
|
|
715
715
|
mock.result.data = data;
|
|
716
716
|
if (errors)
|
|
717
717
|
mock.result.errors = errors;
|
package/package.json
CHANGED
package/script/proxy.js
CHANGED
|
@@ -717,7 +717,7 @@ const operation = (definitions, scalars, query, ...patches) => {
|
|
|
717
717
|
? error
|
|
718
718
|
: Object.assign(new Error(), error);
|
|
719
719
|
}
|
|
720
|
-
else if (data !== undefined)
|
|
720
|
+
else if (data !== undefined && data !== null)
|
|
721
721
|
mock.result.data = data;
|
|
722
722
|
if (errors)
|
|
723
723
|
mock.result.errors = errors;
|
package/types/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type OperationMock<Data extends Record<string, unknown> = Record<string,
|
|
|
23
23
|
variables?: Variables;
|
|
24
24
|
};
|
|
25
25
|
result: {
|
|
26
|
-
data?: Data
|
|
26
|
+
data?: Data;
|
|
27
27
|
errors?: ReadonlyArray<GraphQLError>;
|
|
28
28
|
};
|
|
29
29
|
error?: Error;
|
|
@@ -39,10 +39,11 @@ export type SimpleOperationMock<Data extends Record<string, unknown> = Record<st
|
|
|
39
39
|
watch?: boolean;
|
|
40
40
|
optional?: boolean;
|
|
41
41
|
};
|
|
42
|
-
export type SimpleOperationPatch<Data extends Record<string, unknown> = Record<string, unknown>, Variables = Record<string, unknown> | never> = Patch<{
|
|
42
|
+
export type SimpleOperationPatch<Data extends Record<string, unknown> = Record<string, unknown>, Variables = Record<string, unknown> | never> = Patch<Omit<{
|
|
43
43
|
data: Data;
|
|
44
44
|
variables?: Variables;
|
|
45
|
-
}
|
|
45
|
+
}, "data">> & {
|
|
46
|
+
data?: Patch<Data> | null;
|
|
46
47
|
error?: Error;
|
|
47
48
|
errors?: GraphQLError[];
|
|
48
49
|
watch?: boolean;
|