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

Automatic Upload to S3 Fails #45

Closed
andrewjzhou opened this issue Jul 9, 2018 · 4 comments
Closed

Automatic Upload to S3 Fails #45

andrewjzhou opened this issue Jul 9, 2018 · 4 comments

Comments

@andrewjzhou
Copy link

Hi I am reopening an issue discussed previously (#25). I followed the updated instructions (https://awslabs.github.io/aws-mobile-appsync-sdk-ios/#complex-objects) to a tee and still experienced no success with automatically uploading to S3. I can see that there is an S3Object in my dynamoDB table but nothing gets uploaded to my S3 bucket. I tried uploading the same file using TransferUtility and it works, so I'm not sure what the issue is.

@br3nt0n
Copy link

br3nt0n commented Jul 10, 2018

Have you tried making the S3Object a top level item? I know according to the docs it's not required to be, but I've had success doing it with something like this:
create(post: Post, imageToUpload: S3ObjectInput)

@richienko
Copy link

richienko commented Jul 27, 2018

As I know, the br3nt0n is right, S3Object has to be in top level item.

For example if you have:
create(post: PostInput)

and PostInput is

type PostInput {
  	id: ID!
  	author: String!
  	title: String
  	file: S3Object
  }

change mutation to:
create(post: PostInput, file: S3ObjectInput)

and PostInput to:

type PostInput {
  	id: ID!
  	author: String!
  	title: String
  }

Reason:
In AppSyncComplexObjectsInterceptor, when deciding if operation should upload S3Object, this condition has to be met:
request.operation.queryDocument().contains("S3ObjectInput")

You can check manually for string "S3ObjectInput" in generated Apollo source file for mutation.
If String object OPERATION_DEFINITION in said mutation source doesn't contain string "S3ObjectInput", interceptor will simply ignore it and will not upload file.

@palpatim
Copy link
Contributor

Commenting on this old issue to note that this issue is fixed as of release 2.9.0.

@mopilo
Copy link

mopilo commented Jan 6, 2021

Ah have been experiencing this issue since yesterday and still not solved. using the latest release 3.1.2

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

6 participants