GithubHelp home page GithubHelp logo

Comments (6)

andrewjzhou avatar andrewjzhou commented on August 15, 2024 2

I am having the same issue here. I followed the updated instructions but still have no success with uploading to S3 automatically through AppSync. I checked to upload the same file URI with TransferUtility and everything works.

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on August 15, 2024 1

Hi @end3r117

Thanks for reporting this! I will investigate this issue and post an update here.

Thanks,
Rohan

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on August 15, 2024

Hi @end3r117

Does your mutation with complex objects have the s3 file at the root level? Currently the SDK checks for the file to be at the root level for the upload to happen.

Have you defined the local schema to use the mutation to use S3ObjectInput? For example, the .graphql file in the local iOS dev environment should have a mutation which looks like this:

mutation CreatePost($postInput:PostInput!, $image:S3ObjectInput!){
    createPost(postMetadata:$postInput, image:$image){
        id
    }
}

The decision of whether the mutation is of type graphQLMutationWithS3Object is made early over here:
https://github.com/awslabs/aws-mobile-appsync-sdk-ios/blob/master/AWSAppSyncClient/AWSAppSyncClient.swift#L470

This record is then persisted and retrieved. If the record is not being classified as graphQLMutationWithS3Object it is most likely that the input is not in the expected format; which is validated by this method:

private func checkAndFetchS3Object(variables:GraphQLMap?) -> (bucket: String, key: String, region: String, contentType: String, localUri: String)? {

Also have you followed the documentation posted here:
https://awslabs.github.io/aws-mobile-appsync-sdk-ios/#complex-objects

The doc above contains step by step info on how to add complex objects to your schema.

Thanks,
Rohan

from aws-mobile-appsync-sdk-ios.

end3r117 avatar end3r117 commented on August 15, 2024

Hey, Rohan. I am out of town for the next week and a half but I will try your suggestions, check file locations, and reply with an update ASAP. Please do not close this issue due to my temporary idleness!

Thanks for the help

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on August 15, 2024

We also have updated instructions which walk through the schema setup and client code here: https://awslabs.github.io/aws-mobile-appsync-sdk-ios/#complex-objects which you can try. Closing due to lack of activity.

from aws-mobile-appsync-sdk-ios.

palpatim avatar palpatim commented on August 15, 2024

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

from aws-mobile-appsync-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.