diff --git a/.changeset/config.json b/.changeset/config.json index 1c540ad6..a96e5bac 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,7 +1,7 @@ { - "$schema": "https://unpkg.com/@changesets/config@0.2.4/schema.json", + "$schema": "https://unpkg.com/@changesets/config@1.0.0/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, - "linked": [], + "linked": [["gqless", "@gqless/react"]], "access": "public" } diff --git a/.changeset/nasty-zebras-count.md b/.changeset/nasty-zebras-count.md new file mode 100644 index 00000000..c575f435 --- /dev/null +++ b/.changeset/nasty-zebras-count.md @@ -0,0 +1,5 @@ +--- +'@gqless/schema': patch +--- + +Fix input object nullability diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index 4d8f8196..ac815597 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -1,5 +1,5 @@ { - "installCommand": "install", + "packages": ["gqless", "packages/react", "packages/logger", "packages/utils"], "buildCommand": "build", "sandboxes": ["/examples/react-hackernews"] } diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..ba6f0b2b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +comment: + require_changes: true diff --git a/packages/schema/src/Codegen/files/generated/types.ts b/packages/schema/src/Codegen/files/generated/types.ts index 986520f0..e10b7f3a 100644 --- a/packages/schema/src/Codegen/files/generated/types.ts +++ b/packages/schema/src/Codegen/files/generated/types.ts @@ -221,11 +221,12 @@ export class TypesFile extends File { } public generateField(field: SchemaField, resolveType?: TypeResolver) { + const NULLABLE = field.type.nullable ? '?' : '' const fieldType = this.generateType(field.type, resolveType) if (field.args) this.import(CORE, this.names.FieldsTypeArg) - return `${this.generateFieldComments(field)}${field.name}: ${ + return `${this.generateFieldComments(field)}${field.name}${NULLABLE}: ${ field.args ? `${this.names.FieldsTypeArg}<${this.generateArgs( field.args