Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Anton-Shutik opened this issue Oct 3, 2024 · 0 comments

Comments

@Anton-Shutik
Copy link

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
      }
    }
  }
}
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

No branches or pull requests

1 participant