Questions tagged [aws-appsync]

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.

1785 questions
9
votes
1 answer

Public queries and mutations (no authentication)

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…
Julienmachon
  • 171
  • 1
  • 7
8
votes
0 answers

Add existing AppSync API to AWS Amplify

The problem When I run CodeBuild inside of Amplify, my AppSync credentials are overwritten, breaking the build. Details I'm building a ReactJS site using AWS Amplify as the backend. The project is being deployed using the Amplify built-in CodeBuild.…
8
votes
2 answers

How to return a graphql Union from a python lambda to AWS appsync?

Is it possible to respond with graphql Union from a python lambda? How? It seems possible but I cannot get it over the line. I am including a __typename attribute but most of the time I get this error: {'errorType': 'BadRequestException', …
John Mee
  • 50,179
  • 34
  • 152
  • 186
8
votes
1 answer

AppSync subscriptions with ApolloClient in React

I'm currently using ApolloClient to connect to an AppSync GraphQL API. It all works perfectly for queries and mutations, but I'm having some trouble getting subscriptions to work. I've followed the Apollo docs and my App.js looks like this: import…
Dr Otter
  • 371
  • 2
  • 8
8
votes
2 answers

Appsync Update and Delete mutation not working

I am using AppSync for my APP. Here is a quick look of my Schema.graphql file type Item @model @auth(rules: [ { allow: public, provider: apiKey, operations: [read] }, { allow: groups, groups: ["admin"] } ]) { id: ID! name: String! …
8
votes
5 answers

How to send a GraphQL query to AWS AppSync from the commandline?

The AWS CLI for AppSync has a lovely array of functions to manage it remotely from the command line of my workstation such that mostly I do not have to use the browser console. But to do a query I have to go into the web browser console and find…
John Mee
  • 50,179
  • 34
  • 152
  • 186
8
votes
2 answers

AWS AppSync + React-Apollo Query/useQuery raising exception this.currentObservable.query.getCurrentResult is not a function

I'm new to GraphQL/Apollo thing and I'm having a hard time to setup it with a React application. I have a React component that loads a list from a GraphQL API built using Amplify/AppSync. If I call manually to fetch the items, i.e: const…
dfranca
  • 5,156
  • 2
  • 32
  • 60
8
votes
3 answers

Access requested fields in resolver mapping template

When we request a GraphQL query, for instance, query GetPost { singlePost(id: 123) { id title } } and we have configured a Lambda resolver in AWS AppSync, the request mapping template, { "version": "2017-02-28", "operation":…
bodokaiser
  • 15,122
  • 22
  • 97
  • 140
8
votes
3 answers

AWS AppSync Lambda resolver fields

I have the following query: query xxx { getSomething(id: "id") { field1 field2 } } Is there any way for me to get field1 and field2 in lambda? For example, to query only those fields in mysql, not get all of them just to be…
8
votes
0 answers

Running Lambda functions for server-side validation with AppSync and DynamoDB

I've enjoyed working with AWS Amplify a lot lately, its code generation for GraphQL queries based on defined schema is outstanding. I came across one complication for defining custom logic / validation server-side. Out of the bag AppSync (part…
Ilja
  • 44,142
  • 92
  • 275
  • 498
8
votes
1 answer

AWS AppSync - Adding Global Secondary Index to DynamoDB and pagination using GSI sort key

I am trying to create a structure that lists comments for a post with postId ordered w.r.t. their lastChangeTime descending. The model in the schema is shared below. type Comment { id: ID! postId: String! user: String! lastChangeTime:…
vahdet
  • 6,357
  • 9
  • 51
  • 106
8
votes
3 answers

How to return directly from the request mapper?

Consider the following GraphQL template: type Foo { id: ID! bars: Bars } type Bar { id: ID! name: String! } type Bars { items: [Bar]! nextToken: String } The mapping template for the bars field in the Foo type looks like…
Quentin Hayot
  • 7,786
  • 6
  • 45
  • 62
8
votes
2 answers

How to autogenerate global ID using AppSync + DynamoDB

How do I generate ID automatically when I use AppSync and DynamoDB as the database source? I have a type looking like below type Post { id: ID! creator: String! createdAt: String! like: Int! dislike: Int! frozen:…
forJ
  • 4,309
  • 6
  • 34
  • 60
8
votes
1 answer

DynamoDB: Best hash/sort keys for my use case [confusion with AppSync/GraphQL]

I plan on using AWS Cognito for user auth, DynamoDB for persistence and AppSync (and a lot of Mobile Hub) to power the API - a Book Review site. I'm having a hard time determining which field should be my hash key and which should be my sort key,…
8
votes
1 answer

AWS AppSync Authorization

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…