Skip to content

Serialization of array of custom scalars fails #41

@MrFus10n

Description

@MrFus10n

I created custom Time type map like this:

  Time: {
    serialize: (time: moment.Moment) => time.format("HH:mm:ss"),
    deserialize: (time: string) => moment(time, "HH:mm:ss"),
  }

When mutation accepts single Time value, it works ok. But when it accepts array ([Time!]), serialize function receives array of moment objects instead of getting them one by one.

On the screenshot below, time does not have format because time is array of moments, not moment object.

image

Mutation is called like this:

graphqlClient.chain.mutation
  .userProfileUpdate({input: {times: [
    moment("08:00", "HH:mm"),
    moment("14:00", "HH:mm"),
    moment("20:00", "HH:mm"),
  ]}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions