Skip to content

Commit

Permalink
Fix input object nullability (#72)
Browse files Browse the repository at this point in the history
* fix #71

* add changeset

* fix csb

* fix ci config

* fix ci config
  • Loading branch information
samdenty authored Mar 28, 2020
1 parent 70298d9 commit ca62f66
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 5 additions & 0 deletions .changeset/nasty-zebras-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gqless/schema': patch
---

Fix input object nullability
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"installCommand": "install",
"packages": ["gqless", "packages/react", "packages/logger", "packages/utils"],
"buildCommand": "build",
"sandboxes": ["/examples/react-hackernews"]
}
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
comment:
require_changes: true
3 changes: 2 additions & 1 deletion packages/schema/src/Codegen/files/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca62f66

Please sign in to comment.