Skip to content

Nullable fields in mutations are only made as optional, but not accept Nothing #22

Description

@richardriman

Having another problem with the library.

This is completely valid mutation. It allows me to remove coordinator from event.

mutation UpdateEvent {
  updateEvent(input: { id: "Event:1", coordinatorId: null }) {
     ...
  }

But, generated code does not allow me create that mutation, as it requires input value to be specified. In this case it's Graph.Id. There definitely should be Maybe Graph.Id and conditional handling.

coordinatorId : Graph.Id -> UpdateEventInput -> UpdateEventInput
coordinatorId newArg_ inputObj_ =
    GraphQL.Engine.addField
        "coordinatorId"
        "ID"
        (Graph.id.encode newArg_)
        inputObj_

Thx.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions