Skip to content

UnsignedInt64 should be mapped to string instead of ulong in GraphQL types #1247

Description

@Xriuk

From Shopify GraphQL docs: https://shopify.dev/docs/api/admin-graphql/latest/scalars/UnsignedInt64

An unsigned 64-bit integer. Represents whole numeric values between 0 and 2^64 - 1 encoded as a string of base-10 digits.

Currently here it is mapped to an ulong:

/// <summary>
/// The size of the file to upload, in bytes. This is required when the request's resource property is set to
/// [VIDEO](https://shopify.dev/api/admin-graphql/latest/enums/StagedUploadTargetGenerateUploadResource#value-video)
/// or [MODEL_3D](https://shopify.dev/api/admin-graphql/latest/enums/StagedUploadTargetGenerateUploadResource#value-model3d).
/// </summary>
[JsonPropertyName("fileSize")]
public ulong? fileSize { get; set; } = null;

But from the Shopify docs it is also used elsewhere.

From the docs it should be a string instead: https://shopify.dev/docs/api/admin-graphql/latest/input-objects/StagedUploadInput#fields-fileSize

Or it gives the same error as in #1188 (I don't know why it went un-noticed):

Variable $input of type [StagedUploadInput!]! was provided invalid value for 0.fileSize (UnsignedInt64 '193549' must be encoded as a string)

A workaround is to use an anonymous type with fileSize property set to string instead of using StagedUploadInput directly.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions