* Which Category is your question related to? *
graphql-transformer
* What AWS Services are you utilizing? *
AWS Appsynce graphql-transformer
* Provide additional details e.g. code snippets *
Whats the magic sauce with S3Object types with the templates its seems its undocumented and honestly talking about S3Object type is under documented on the AWS AppSync docs. I had to find it in a talk they gave.
Do I need to provide the input and type schema?
Does a connection make sense / necessary for S3Objects?
# Content Media type holder
type Media @model {
id: ID
# Display name of media
name: String
# Display description of media
description: String
# Media file stored in S3
data: S3Object @connection
# Substitle file associated with media file stored in S3
subtitle: S3Object @connection <---- is this necessary with the templates
}
# S3 Object type to enable retreival of S3 Object
type S3Object @model{
# S3 Bucket the object is in
bucket: String!
# S3 Region the bucket is in
region: String!
# S3 key for the object
key: String!
}
# S3 Object type to enable insertion of S3 Object
input S3ObjectInput { <---- is this necessary with the templates
# S3 Bucket to put the object in
bucket: String!
# S3 region to put the object in
region: String!
# Location of the file being upload on the machine uploading
localUri: String
# Access rules for object
visibility: Visibility
# S3 key to set for the object
key: String
# Mime type of the file being uploaded (e.g. text/plain, image/png)
mimeType: String
}
Is it possible to add @searchable to the S3Object. Does @versioned need to be used if I'm going to update data?
You can add S3 support via the transformer by adding this type to your schema.
type S3Object {
bucket: String;
key: String;
region: String;
}
The S3ObjectInput
type will be generated for you (as input types are generated for all non @model types) and then you can store pointers to objects in DynamoDB via AppSync. From your mobile app you can then use S3 SDKs directly or the Amplify client toolchain to download the files directly to the phone in the traditional way.
If using javascript and the AppSync JS SDK then see this sample:
https://github.com/aws-samples/aws-amplify-graphql
Specifically:
@austinamorusocfc Please feel free to re-open this issue if the problem still persists. Thanks!
@kaustavghosh06 my question have been answered! Thanks @mikeparisstuff
Can this be reopened?? Documentation is lacking very much when trying to configure S3Object into App Sync. I've read through just about everything and still very confused.
Seems that they deleted all the examples of using graphQL with S3 for a React Native app!!!!
I'm hit with https://github.com/aws-amplify/docs/issues/587
Most helpful comment
Can this be reopened?? Documentation is lacking very much when trying to configure S3Object into App Sync. I've read through just about everything and still very confused.