Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
fix(stitching): input fields without default value
Browse files Browse the repository at this point in the history
Input fields without default values should not have default values of
null after transformation -- they should still have no default values.
Closes #15.
  • Loading branch information
bconnorwhite authored and yaacovCR committed Aug 20, 2019
1 parent 369e9e3 commit 786a855
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/test/testAlternateMergeSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@ type Property {
type Query {
propertyById(id: ID!): Property
properties(limit: Int = null): [Property!]
properties(limit: Int): [Property!]
contextTest(key: String!): String
dateTimeTest: DateTime
jsonTest(input: JSON = null): JSON
interfaceTest(kind: TestInterfaceKind = null): TestInterface
unionTest(output: String = null): TestUnion
jsonTest(input: JSON): JSON
interfaceTest(kind: TestInterfaceKind): TestInterface
unionTest(output: String): TestUnion
errorTest: String
errorTestNonNull: String!
relay: Query!
Expand Down
2 changes: 1 addition & 1 deletion src/transformInputValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type InputValueTransformer = (type: GraphQLEnumType | GraphQLScalarType, origina

export function transformInputValue(type: GraphQLInputType, value: any, transformer: InputValueTransformer) {
if (value == null) {
return null;
return value;
}

const nullableType = getNullableType(type);
Expand Down

0 comments on commit 786a855

Please sign in to comment.