diff --git a/.changeset/lucky-bears-kiss.md b/.changeset/lucky-bears-kiss.md new file mode 100644 index 00000000000..b1491121c11 --- /dev/null +++ b/.changeset/lucky-bears-kiss.md @@ -0,0 +1,6 @@ +--- +'@keystone-next/keystone': major +'@keystone-next/types': major +--- + +Updated `@graphql-ts/schema`. The second type parameter of `schema.Arg` exported from `@keystone-next/types` is now a boolean that defines whether or not the arg has a default value to make it easier to define circular input objects. diff --git a/packages/keystone/src/lib/id-field.ts b/packages/keystone/src/lib/id-field.ts index 606f31480aa..5f3fd34136f 100644 --- a/packages/keystone/src/lib/id-field.ts +++ b/packages/keystone/src/lib/id-field.ts @@ -55,7 +55,7 @@ const nonCircularFields = { type IDFilterType = schema.InputObjectType< typeof nonCircularFields & { - not: schema.Arg; + not: schema.Arg; } >; diff --git a/packages/types/package.json b/packages/types/package.json index f8c35d64195..ac5cf78910e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@babel/runtime": "^7.14.8", - "@graphql-ts/schema": "0.1.2", + "@graphql-ts/schema": "0.2.0", "@keystone-next/fields": "^13.0.0", "apollo-server-types": "^0.9.0", "cors": "^2.8.5", diff --git a/packages/types/src/filters/enum-filter.ts b/packages/types/src/filters/enum-filter.ts index dd29bbbaed0..c6d91228411 100644 --- a/packages/types/src/filters/enum-filter.ts +++ b/packages/types/src/filters/enum-filter.ts @@ -11,14 +11,14 @@ export type EnumNullableFilter> = schema.Input // can be null notIn: schema.Arg>>; // can be null - not: schema.Arg, undefined>; + not: schema.Arg>; }>; export type EnumFilter> = schema.InputObjectType<{ equals: schema.Arg; in: schema.Arg>>; notIn: schema.Arg>>; - not: schema.Arg, undefined>; + not: schema.Arg>; }>; type EnumNullableListFilterType> = schema.InputObjectType<{ diff --git a/packages/types/src/filters/providers/postgresql.ts b/packages/types/src/filters/providers/postgresql.ts index dd69d069c51..cac24d557da 100644 --- a/packages/types/src/filters/providers/postgresql.ts +++ b/packages/types/src/filters/providers/postgresql.ts @@ -7,21 +7,21 @@ import { QueryMode } from '../..'; type StringNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; - mode: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; + mode: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const StringNullableFilter: StringNullableFilterType = schema.inputObject({ @@ -48,20 +48,20 @@ const StringNullableFilter: StringNullableFilterType = schema.inputObject({ type NestedStringNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const NestedStringNullableFilter: NestedStringNullableFilterType = schema.inputObject({ @@ -86,18 +86,18 @@ const NestedStringNullableFilter: NestedStringNullableFilterType = schema.inputO }); type StringFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; - mode: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; + mode: schema.Arg; + not: schema.Arg; }>; const StringFilter: StringFilterType = schema.inputObject({ @@ -119,17 +119,17 @@ const StringFilter: StringFilterType = schema.inputObject({ }); type NestedStringFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; + not: schema.Arg; }>; const NestedStringFilter: NestedStringFilterType = schema.inputObject({ @@ -151,12 +151,12 @@ const NestedStringFilter: NestedStringFilterType = schema.inputObject({ type StringNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const StringNullableListFilter: StringNullableListFilterType = schema.inputObject({ @@ -174,9 +174,9 @@ const StringNullableListFilter: StringNullableListFilterType = schema.inputObjec type BoolNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const BoolNullableFilter: BoolNullableFilterType = schema.inputObject({ @@ -190,8 +190,8 @@ const BoolNullableFilter: BoolNullableFilterType = schema.inputObject({ }); type BoolFilterType = schema.InputObjectType<{ - equals: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + not: schema.Arg; }>; const BoolFilter: BoolFilterType = schema.inputObject({ @@ -204,12 +204,12 @@ const BoolFilter: BoolFilterType = schema.inputObject({ type BoolNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const BoolNullableListFilter: BoolNullableListFilterType = schema.inputObject({ @@ -227,17 +227,17 @@ const BoolNullableListFilter: BoolNullableListFilterType = schema.inputObject({ type IntNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const IntNullableFilter: IntNullableFilterType = schema.inputObject({ @@ -259,14 +259,14 @@ const IntNullableFilter: IntNullableFilterType = schema.inputObject({ }); type IntFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const IntFilter: IntFilterType = schema.inputObject({ @@ -285,12 +285,12 @@ const IntFilter: IntFilterType = schema.inputObject({ type IntNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const IntNullableListFilter: IntNullableListFilterType = schema.inputObject({ @@ -308,17 +308,17 @@ const IntNullableListFilter: IntNullableListFilterType = schema.inputObject({ type FloatNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const FloatNullableFilter: FloatNullableFilterType = schema.inputObject({ @@ -340,14 +340,14 @@ const FloatNullableFilter: FloatNullableFilterType = schema.inputObject({ }); type FloatFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const FloatFilter: FloatFilterType = schema.inputObject({ @@ -366,12 +366,12 @@ const FloatFilter: FloatFilterType = schema.inputObject({ type FloatNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const FloatNullableListFilter: FloatNullableListFilterType = schema.inputObject({ @@ -389,17 +389,17 @@ const FloatNullableListFilter: FloatNullableListFilterType = schema.inputObject( type DateTimeNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const DateTimeNullableFilter: DateTimeNullableFilterType = schema.inputObject({ @@ -421,14 +421,14 @@ const DateTimeNullableFilter: DateTimeNullableFilterType = schema.inputObject({ }); type DateTimeFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const DateTimeFilter: DateTimeFilterType = schema.inputObject({ @@ -447,12 +447,12 @@ const DateTimeFilter: DateTimeFilterType = schema.inputObject({ type DateTimeNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const DateTimeNullableListFilter: DateTimeNullableListFilterType = schema.inputObject({ @@ -470,9 +470,9 @@ const DateTimeNullableListFilter: DateTimeNullableListFilterType = schema.inputO type JsonNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const JsonNullableFilter: JsonNullableFilterType = schema.inputObject({ @@ -486,8 +486,8 @@ const JsonNullableFilter: JsonNullableFilterType = schema.inputObject({ }); type JsonFilterType = schema.InputObjectType<{ - equals: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + not: schema.Arg; }>; const JsonFilter: JsonFilterType = schema.inputObject({ @@ -500,12 +500,12 @@ const JsonFilter: JsonFilterType = schema.inputObject({ type JsonNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const JsonNullableListFilter: JsonNullableListFilterType = schema.inputObject({ @@ -523,17 +523,17 @@ const JsonNullableListFilter: JsonNullableListFilterType = schema.inputObject({ type DecimalNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const DecimalNullableFilter: DecimalNullableFilterType = schema.inputObject({ @@ -555,14 +555,14 @@ const DecimalNullableFilter: DecimalNullableFilterType = schema.inputObject({ }); type DecimalFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const DecimalFilter: DecimalFilterType = schema.inputObject({ @@ -581,12 +581,12 @@ const DecimalFilter: DecimalFilterType = schema.inputObject({ type DecimalNullableListFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg>, undefined>; + equals: schema.Arg>>; // can be null - has: schema.Arg; - hasEvery: schema.Arg>, undefined>; - hasSome: schema.Arg>, undefined>; - isEmpty: schema.Arg; + has: schema.Arg; + hasEvery: schema.Arg>>; + hasSome: schema.Arg>>; + isEmpty: schema.Arg; }>; const DecimalNullableListFilter: DecimalNullableListFilterType = schema.inputObject({ diff --git a/packages/types/src/filters/providers/sqlite.ts b/packages/types/src/filters/providers/sqlite.ts index 6ac15d260b8..20591155798 100644 --- a/packages/types/src/filters/providers/sqlite.ts +++ b/packages/types/src/filters/providers/sqlite.ts @@ -5,20 +5,20 @@ import { schema } from '../../schema'; type StringNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const StringNullableFilter: StringNullableFilterType = schema.inputObject({ @@ -44,20 +44,20 @@ const StringNullableFilter: StringNullableFilterType = schema.inputObject({ type NestedStringNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const NestedStringNullableFilter: NestedStringNullableFilterType = schema.inputObject({ @@ -82,17 +82,17 @@ const NestedStringNullableFilter: NestedStringNullableFilterType = schema.inputO }); type StringFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; + not: schema.Arg; }>; const StringFilter: StringFilterType = schema.inputObject({ @@ -113,17 +113,17 @@ const StringFilter: StringFilterType = schema.inputObject({ }); type NestedStringFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - contains: schema.Arg; - startsWith: schema.Arg; - endsWith: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + contains: schema.Arg; + startsWith: schema.Arg; + endsWith: schema.Arg; + not: schema.Arg; }>; const NestedStringFilter: NestedStringFilterType = schema.inputObject({ @@ -145,9 +145,9 @@ const NestedStringFilter: NestedStringFilterType = schema.inputObject({ type BoolNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const BoolNullableFilter: BoolNullableFilterType = schema.inputObject({ @@ -161,8 +161,8 @@ const BoolNullableFilter: BoolNullableFilterType = schema.inputObject({ }); type BoolFilterType = schema.InputObjectType<{ - equals: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + not: schema.Arg; }>; const BoolFilter: BoolFilterType = schema.inputObject({ @@ -175,17 +175,17 @@ const BoolFilter: BoolFilterType = schema.inputObject({ type IntNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const IntNullableFilter: IntNullableFilterType = schema.inputObject({ @@ -207,14 +207,14 @@ const IntNullableFilter: IntNullableFilterType = schema.inputObject({ }); type IntFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const IntFilter: IntFilterType = schema.inputObject({ @@ -233,17 +233,17 @@ const IntFilter: IntFilterType = schema.inputObject({ type FloatNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const FloatNullableFilter: FloatNullableFilterType = schema.inputObject({ @@ -265,14 +265,14 @@ const FloatNullableFilter: FloatNullableFilterType = schema.inputObject({ }); type FloatFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const FloatFilter: FloatFilterType = schema.inputObject({ @@ -291,17 +291,17 @@ const FloatFilter: FloatFilterType = schema.inputObject({ type DateTimeNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const DateTimeNullableFilter: DateTimeNullableFilterType = schema.inputObject({ @@ -323,14 +323,14 @@ const DateTimeNullableFilter: DateTimeNullableFilterType = schema.inputObject({ }); type DateTimeFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const DateTimeFilter: DateTimeFilterType = schema.inputObject({ @@ -349,17 +349,17 @@ const DateTimeFilter: DateTimeFilterType = schema.inputObject({ type DecimalNullableFilterType = schema.InputObjectType<{ // can be null - equals: schema.Arg; + equals: schema.Arg; // can be null - in: schema.Arg>, undefined>; + in: schema.Arg>>; // can be null - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; // can be null - not: schema.Arg; + not: schema.Arg; }>; const DecimalNullableFilter: DecimalNullableFilterType = schema.inputObject({ @@ -381,14 +381,14 @@ const DecimalNullableFilter: DecimalNullableFilterType = schema.inputObject({ }); type DecimalFilterType = schema.InputObjectType<{ - equals: schema.Arg; - in: schema.Arg>, undefined>; - notIn: schema.Arg>, undefined>; - lt: schema.Arg; - lte: schema.Arg; - gt: schema.Arg; - gte: schema.Arg; - not: schema.Arg; + equals: schema.Arg; + in: schema.Arg>>; + notIn: schema.Arg>>; + lt: schema.Arg; + lte: schema.Arg; + gt: schema.Arg; + gte: schema.Arg; + not: schema.Arg; }>; const DecimalFilter: DecimalFilterType = schema.inputObject({ diff --git a/packages/types/src/json-field-type-polyfill-for-sqlite.ts b/packages/types/src/json-field-type-polyfill-for-sqlite.ts index 5ea475b0fed..9ad7a9a307c 100644 --- a/packages/types/src/json-field-type-polyfill-for-sqlite.ts +++ b/packages/types/src/json-field-type-polyfill-for-sqlite.ts @@ -98,8 +98,8 @@ export function jsonFieldTypePolyfilledForSQLite< ScalarDBField<'Json', 'optional'>, CreateArg, UpdateArg, - schema.Arg, - schema.Arg + schema.Arg, + schema.Arg > & { input?: { uniqueWhere?: undefined; diff --git a/packages/types/src/next-fields.ts b/packages/types/src/next-fields.ts index 83284da4b04..645f36b37a8 100644 --- a/packages/types/src/next-fields.ts +++ b/packages/types/src/next-fields.ts @@ -39,17 +39,17 @@ export type NextFieldType< | schema.Arg | undefined, UpdateArg extends schema.Arg = schema.Arg, - UniqueWhereArg extends schema.Arg = schema.Arg< + UniqueWhereArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false >, - OrderByArg extends schema.Arg = schema.Arg< + OrderByArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false >, - FilterArg extends schema.Arg = schema.Arg< + FilterArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false > > = { dbField: TDBField; @@ -351,17 +351,17 @@ export type FieldTypeWithoutDBField< | schema.Arg | undefined, UpdateArg extends schema.Arg = schema.Arg, - UniqueWhereArg extends schema.Arg = schema.Arg< + UniqueWhereArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false >, - OrderByArg extends schema.Arg = schema.Arg< + OrderByArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false >, - FilterArg extends schema.Arg = schema.Arg< + FilterArg extends schema.Arg = schema.Arg< schema.NullableInputType, - undefined + false > > = { input?: { @@ -393,9 +393,9 @@ export function fieldType(dbField: TDBField) { return function < CreateArg extends schema.Arg | undefined, UpdateArg extends schema.Arg, - UniqueWhereArg extends schema.Arg, - OrderByArg extends schema.Arg, - FilterArg extends schema.Arg + UniqueWhereArg extends schema.Arg, + OrderByArg extends schema.Arg, + FilterArg extends schema.Arg >( stuff: FieldTypeWithoutDBField< TDBField, @@ -453,13 +453,13 @@ export type TypesForList = { }; export type FindManyArgs = { - where: schema.Arg, {}>; + where: schema.Arg, true>; orderBy: schema.Arg< schema.NonNullType>>, - Record[] + true >; take: schema.Arg; - skip: schema.Arg, number>; + skip: schema.Arg, true>; }; export type FindManyArgsValue = schema.InferValueFromArgs; diff --git a/prisma-utils/src/index.ts b/prisma-utils/src/index.ts index d27cf905cae..c4570a8c39f 100644 --- a/prisma-utils/src/index.ts +++ b/prisma-utils/src/index.ts @@ -280,7 +280,7 @@ function printInputTypeForGraphQLTS( field.isList ? `schema.ListType>` : `typeof ${field.type}` - }, undefined>`; + }>`; }) .join(',\n')} }> diff --git a/yarn.lock b/yarn.lock index d1cafddddfe..759cf040fd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1535,10 +1535,10 @@ dependencies: tslib "~2.3.0" -"@graphql-ts/schema@0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@graphql-ts/schema/-/schema-0.1.2.tgz#71b04cc88ff61f5c19a81ac70f878b1e36f617da" - integrity sha512-ZP4Nj70B18q1Y7B4WHeJR5gMyoH8oX9umnpmT9gu6kUD9rmTZfqHE9cGHRisw+ZOlWBnx6rPrx0BmUROFQFORA== +"@graphql-ts/schema@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@graphql-ts/schema/-/schema-0.2.0.tgz#1fc11a985cd5b0534de6616abcf05b0b493b8252" + integrity sha512-4hLQW5RfJkSkqia3Tl/LRVjsIGziTN/fHsUEuSIg1quD0y3pPpQxisDAIt4nkevY53q+JuGSVG1isJz+v8Ym/g== dependencies: "@babel/runtime" "^7.9.2"