Skip to content

GraphQLClientGraphQLMultiError: List dimension mismatch on variable $input_0 and argument input (StagedUploadInput! / [StagedUploadInput!]!) #321

Open
@Anton-Shutik

Description

@Anton-Shutik

It does not handle List input type correctly

with

plugins = ["ariadne_codegen.contrib.extract_operations.ExtractOperationsPlugin"]

in my schema.graphql I have mutation like this

type Mutation {
...
  stagedUploadsCreate(input: [StagedUploadInput!]!): StagedUploadsCreatePayload
...

which generates Mutation.staged_uploads_create class like this:

    @classmethod
    def staged_uploads_create(
        cls, input: StagedUploadInput
    ) -> StagedUploadsCreatePayloadFields:
        arguments: Dict[str, Dict[str, Any]] = {
            "input": {"type": "StagedUploadInput!", "value": input} # This input.type is incorrect 
            # "input": {"type": "[StagedUploadInput!]!", "value": input} This type is correct
        }
        cleared_arguments = {
            key: value for key, value in arguments.items() if value["value"] is not None
        }
        return StagedUploadsCreatePayloadFields(
            field_name="stagedUploadsCreate", arguments=cleared_arguments
        )

then, when executing it sends wrong type. Correct should be [StagedUploadInput!]!

mutation stagedUploadsCreate($input_0: StagedUploadInput!) {
  stagedUploadsCreate(input: $input_0) {
    stagedTargets {
      url
      resourceUrl
      parameters {
        name
        value
      }
    }
  }
}

Metadata

Metadata

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