AWS AppSync lets you build data-driven apps with real-time and offline-first capabilities based on GraphQL with custom resolver support for DynamoDB, ElasticSearch, AWS Lambda, and Local datasources.
Questions tagged [aws-appsync]
1332 questions
41
votes
0 answers
N+1 queries in AWS AppSync
When using AWS AppSync with lambda data sources you can encounter N+1 query problem.
Basically when you have individual field resolver on your type and your query returns an array of those types you field resolver lambda will be called N times.
AWS…
AlpacaGoesCrazy
- 586
- 5
- 12
21
votes
1 answer
AWS GraphQL: Variable 'input' has coerced Null value for NonNull type 'Input!'
I'm using ReactJS and aws-amplify to execute graphql operations.
CODE:
import {
API,
graphqlOperation
} from 'aws-amplify';
import { UpdateInput } from './mutations.js';
// Call mutation
const input = { /* some values */…
Joseph D.
- 10,071
- 3
- 21
- 54
19
votes
2 answers
AWS Amplify - AppSync & Multiple DynamoDB Tables
When initializing a new GraphQL backend via the Amplify CLI, the sample schema defines multiple types with the @model annotation. For example...
type Blog @model {
id: ID!
name: String!
posts: [Post] @connection(name: "BlogPosts")
}
type Post…
Kyle Magilavy
- 667
- 5
- 9
19
votes
2 answers
How to upload file to AWS S3 using AWS AppSync
Following this docs/tutorial in AWS AppSync Docs.
It states:
With AWS AppSync you can model these as GraphQL types. If any of your mutations have a variable with bucket, key, region, mimeType and localUri fields, the SDK will upload the file to…
SaidAkh
- 1,049
- 2
- 10
- 20
18
votes
3 answers
Where can I log & debug Velocity Template Language (VTL) in AWS AppSync?
Is there any easy way to log or debug VTL coming from Request Mapping Template & Response Mapping Template rather than sending Queries & Mutations to debug & log?
Also, is there any Playground to check & play with VTL just like we can do with…
deadcoder0904
- 3,758
- 1
- 27
- 91
17
votes
2 answers
AppSync: Nested Type Resolver
I try to include nested types defined in the following graphql schema:
type User {
id: String!
posts: [Post]
}
type Post {
id: String!
}
type Query {
getUser(id: String!): User
getPost(id: String!): Post
}
As you can see a User has…
Knowledge
- 1,587
- 2
- 19
- 30
16
votes
0 answers
What are the pros and cons of using AWS AppSync vs Firestore for scalable chat application?
I am planning to develop a scalable chat application as a part of a project, project is mobile app hoping to expand to the web. I came to consider the following options
AWS AppSync
Cloud Firestore
Currently I am using Firebase in my mobile app for…
user158
- 9,766
- 7
- 39
- 71
15
votes
2 answers
Is there a way to test AppSync code locally and/or in CI/CD?
I am looking to dive into a project using AppSync. So far I have been able to find plenty of articles and such online giving all the steps as to what buttons to click in order to get a sample project running, but none of them seem to touch on how…
CodeChimp
- 7,511
- 3
- 35
- 76
15
votes
5 answers
AppSync: Get user information in $context when using AWS_IAM auth
In AppSync, when you use Cognito User Pools as your auth setting your identity you get
identity:
{ sub: 'bcb5cd53-315a-40df-a41b-1db02a4c1bd9',
issuer: 'https://cognito-idp.us-west-2.amazonaws.com/us-west-2_oicu812',
username:…
honkskillet
- 2,374
- 1
- 27
- 41
15
votes
2 answers
Custom filtering on subscription in AWS AppSync
Is it possible to have custom filtering logic on subscription in AWS AppSync?
As I know, current behavior is:
e.g. my schema is like the following
type Mutation {
createEvent(userId: ID!, event: Event!): Event!
}
type Subscription {
…
Vincent Pang
- 384
- 3
- 8
14
votes
1 answer
Difference between AWS Amplify & Apollo Client for GraphQL?
I agree Apollo Client is a pain to set up because of lots of boilerplate (although it becomes simple after reading the docs) & things like AWS Amplify, URQL, Apollo Boost & Micro GraphQL React makes it easy to work with GraphQL on the client.
I am…
deadcoder0904
- 3,758
- 1
- 27
- 91
14
votes
1 answer
Apollo - update() method getting called twice, both times with optimistic/fake data
I'm completely stuck on an Apollo problem, for which I've opened a GitHub issue and had zero response on.
I'm calling an Apollo mutation, using optimisticResponse. The way it's supposed to work, as I understand it, is that update() gets called…
ffxsam
- 20,847
- 29
- 72
- 128
14
votes
1 answer
AWS AppSync - rate limiting?
Is there a way to rate limit clients easily with AWS AppSync? API Gateway has this, and they're pretty similar services. I'd like to be able to throttle individual clients - so one user can't sit there and bang on the API too hard.
Probably not on…
Michael Economy
- 598
- 3
- 20
13
votes
2 answers
AWS-Amplify API module: how to make GraphQL fields unique?
AWS-Amplify provides a couple of directives to build an GraphQL-API. But I haven't found out how to ensure uniqueness for fields.
I want to do something like in GraphCool:
type Tag @model @searchable {
id: ID!
label: String! @isUnique
}
This is…
Philip Claren
- 1,972
- 1
- 17
- 28
12
votes
1 answer
AWS Appsync $ctx vs $context in resolvers
I understand that context is what ever name you define in your Lambda functions but when it comes to Appsync resolvers I'm a bit confused. I've seen both $ctx and $context being used in AppSync resolvers including in AWS docs. Some of AWS's own code…
user3376065
- 935
- 8
- 27