Skip to content

Commit

Permalink
fix(domains): input field nullable if domain has default (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbretl authored and benjie committed Feb 24, 2019
1 parent b29ff05 commit dd2ca61
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/graphile-build-pg/src/plugins/PgColumnsPlugin.js
Expand Up @@ -236,7 +236,8 @@ export default (function PgColumnsPlugin(builder) {
isPgBaseInput ||
isPgPatch ||
(!attr.isNotNull &&
!attr.type.domainIsNotNull &&
(!attr.type.domainIsNotNull ||
attr.type.domainHasDefault) &&
!attr.tags.notNull) ||
attr.hasDefault ||
attr.identity === "d",
Expand Down
Expand Up @@ -245,6 +245,7 @@ with
nullif(typ.typrelid, 0) as "classId",
nullif(typ.typbasetype, 0) as "domainBaseTypeId",
nullif(typ.typtypmod, -1) as "domainTypeModifier",
typ.typdefaultbin is not null as "domainHasDefault",
-- If this type is an enum type, let’s select all of its enum variants.
--
-- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-enum.html
Expand Down
Expand Up @@ -3003,7 +3003,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}

\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down Expand Up @@ -12478,7 +12478,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}

\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -1111,7 +1111,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -3003,7 +3003,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -3394,7 +3394,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -3008,7 +3008,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -960,7 +960,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -1111,7 +1111,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -4318,7 +4318,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}

\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -1110,7 +1110,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
rowId: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -1111,7 +1111,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}
\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down
Expand Up @@ -2745,7 +2745,7 @@ input Issue756Condition {
\\"\\"\\"An input for mutations affecting \`Issue756\`\\"\\"\\"
input Issue756Input {
id: Int
ts: NotNullTimestamp!
ts: NotNullTimestamp
}

\\"\\"\\"All input for the \`issue756Mutation\` mutation.\\"\\"\\"
Expand Down

0 comments on commit dd2ca61

Please sign in to comment.