aws-appsync

AppSync S3Object retrieval

风格不统一 提交于 2019-12-04 12:45:08
My files are currently being uploaded to an s3 bucket according to the tutorials provided. I have a Post type with a file field pointing to an S3Object. S3Object has the values of bucket, key, and region. I want to allow my users to download their uploaded files, but I cannot access Post > file through a query. This means I cannot get the download URL. Right now, DynamoDB stores the following for file upon upload (I've changed the values here): {"s3":{"key":"id.pdf","bucket":"my-bucket","region":"my-region"}} My resolver for Post > file looks like this: { "version": "2017-02-28", "operation":

How do I subscribe directly to my AWS AppSync data source?

拟墨画扇 提交于 2019-12-04 09:36:11
问题 I have a DynamoDB connected to step functions and I am building a UI to display changes. I connected the DB to an AppSync instance and have tried using subscriptions through AppSync, but it seems they only observe mutations within the current AppSync. How can I subscribe to the data source changes directly? 回答1: You are correct. Currently, AppSync Subscriptions are only triggered from GraphQL Mutations. If there are changes made to the DynamoDB from a source other than AppSync, subscriptions

Group authorization in AppSync using IAM authentication

独自空忆成欢 提交于 2019-12-04 05:46:58
My service requires user groups for authorising access to data. Group authorization examples in AppSync documentation are based on User Pool claims. I'm using IAM authentication so $context.identity doesn't include claims or any similar information. See, for example, topic "Use Case: Group Can Create New Record" in: https://docs.aws.amazon.com/appsync/latest/devguide/security-authorization-use-cases.html #set($expression = "") #set($expressionValues = {}) #foreach($group in $context.identity.claims.get("cognito:groups")) #set( $expression = "${expression} contains(groupsCanAccess, :var$foreach

Public queries and mutations (no authentication)

我是研究僧i 提交于 2019-12-03 13:48:46
问题 The documentation says there are 3 ways we can authorise an application to interact with the API, but it doesn't look like there is a way of having a public endpoint. For example, if I want anyone to query a list of todos, but only authenticated users can add a todo to that list, how can I achieve this? Or if I want to allow anyone to do a schema introspection, but restrict all other queries to authenticated users, is it possible? I'm using cognito for authentication. I noticed there is a

Is it possible to build offline-first mobile apps using AWS AppSync?

淺唱寂寞╮ 提交于 2019-12-03 09:41:07
问题 I'd like to use AWS AppSync for mobile development (Android/iOS) but I’m not sure about its offline capabilities. According to the documentation the data will be accessible while being offline and synced automatically if the client gets online again. But I can't find any information about if the app client needs to connect to AWS first, before using AppSync to create and modify offline data. I'm not familiar with the underlying technologies of AppSync (e.g. GraphQL) and I don't have access to

aws-amplify subscription to appsync stops after 2 mins

一世执手 提交于 2019-12-03 08:27:07
When subscribing to appsync using amplify using API.graphql(graphqlOperation(subscription)); the subscription works for a while, but the I get socket closed error. CONSOLE LOG [native code]: { "[INFO] 24:12.893 MqttOverWSProvider": { "errorCode": 8, "errorMessage": "AMQJS0008I Socket closed.", "uri": "wss://<uri> The same subscription works in the appsync console without any issue and I get events as long as the subscription is running, but stops after around 2 mins on device. code involved let cs = await this.subscriptionService.appSubscriptions(); this.sbscriptions = this.cs.subscribe({ next

AWS AppSync Authorization

北战南征 提交于 2019-12-03 06:58:24
I'm planning to use AWS Appsync to migrate a graphQL endpoint in a lambda function, which is being triggered by a POST via the API Gateway. I'm looking into AppSync mainly because of the subscriptions, which I can't create using a Lambda function. My Authentication mechanism is based on Auth0, using passwordless, and my authorization mechanism in based on the data from several tables in DynamoDB and it's embedded in the graphQL resolvers, as recommended by Facebook and Apollo. What is more, it is based on every part of the request, which includes checking permission to invoke the query

Public queries and mutations (no authentication)

强颜欢笑 提交于 2019-12-03 03:04:31
The documentation says there are 3 ways we can authorise an application to interact with the API, but it doesn't look like there is a way of having a public endpoint. For example, if I want anyone to query a list of todos, but only authenticated users can add a todo to that list, how can I achieve this? Or if I want to allow anyone to do a schema introspection , but restrict all other queries to authenticated users, is it possible? I'm using cognito for authentication. I noticed there is a AppId client regex field that says (Optional) Type a regular expression to allow or block requests to

Is it possible to build offline-first mobile apps using AWS AppSync?

◇◆丶佛笑我妖孽 提交于 2019-12-03 00:04:17
I'd like to use AWS AppSync for mobile development (Android/iOS) but I’m not sure about its offline capabilities. According to the documentation the data will be accessible while being offline and synced automatically if the client gets online again. But I can't find any information about if the app client needs to connect to AWS first, before using AppSync to create and modify offline data. I'm not familiar with the underlying technologies of AppSync (e.g. GraphQL) and I don't have access to the public preview version to test it myself. I would like to enable privacy-sensitive users to use an

DynamoDB AppSync field resolvers timing out

﹥>﹥吖頭↗ 提交于 2019-12-02 04:31:06
So I have the schema below. If I try to query data off this schema AppSync will time out saying 'NetworkError when attempting to fetch resource.' type Model { PartitionKey: ID! SortKey: ID! Name: String Version: Int FBX: String # ms since epoch CreatedAt: AWSTimestamp Description: String Tags: [Tag] } type ImageSet { PartitionKey: ID! SortKey: ID! Name: String CreatedAt: AWSTimestamp Description: String Tags: [String] } Now, if I change 'Name' in the model to 'ModelName' then queries on that will work. If I change 'Name' in ImageSet to 'SetName' then queries on that will work. What is going on