Skip to content

Allow for distinct input types for create and update#15

Closed
andreachild wants to merge 1 commit intomainfrom
achildCreateUpdateInput
Closed

Allow for distinct input types for create and update#15
andreachild wants to merge 1 commit intomainfrom
achildCreateUpdateInput

Conversation

@andreachild
Copy link

Allow for distinct input types for create and update, which can have different non-nullable fields.

const createFields = [];
for (const field of def.fields) {
if (isScalar(nullable(field.type))) {
if (field.type.kind === 'NonNullType' && field.type.type.name.value === GraphQLID.name) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use optional chaining to avoid reference errors:

field.type?.kind === 'NonNullType' && field.type?.type?.name?.value === GraphQLID.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant