{"id":13532523,"url":"https://github.com/amazon-archives/aws-appsync-relay","last_synced_at":"2025-04-01T20:32:17.188Z","repository":{"id":53828379,"uuid":"151639295","full_name":"amazon-archives/aws-appsync-relay","owner":"amazon-archives","description":"A sample Relay app using AWS AppSync","archived":true,"fork":false,"pushed_at":"2021-03-12T06:01:50.000Z","size":574,"stargazers_count":59,"open_issues_count":3,"forks_count":12,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-12-24T19:29:34.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-archives.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-04T21:40:45.000Z","updated_at":"2023-07-25T15:41:51.000Z","dependencies_parsed_at":"2022-08-21T15:20:30.822Z","dependency_job_id":null,"html_url":"https://github.com/amazon-archives/aws-appsync-relay","commit_stats":null,"previous_names":["aws-samples/aws-appsync-relay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-archives","download_url":"https://codeload.github.com/amazon-archives/aws-appsync-relay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:11.604Z","updated_at":"2025-04-01T20:32:12.162Z","avatar_url":"https://github.com/amazon-archives.png","language":"JavaScript","funding_links":[],"categories":["Example Projects","JavaScript"],"sub_categories":[],"readme":"AWS AppSync Relay\n=================\n\nThis sample project shows how to use the Relay library together with an AWS AppSync backend. See [the blog post](https://medium.com/open-graphql/using-relay-with-aws-appsync-55c89ca02066) for more in-depth discussion.\n\nHere are links to some of the key technologies used in the project:\n\n- [AWS AppSync](https://docs.aws.amazon.com/appsync/latest/devguide/welcome.html)\n- The [AWS Amplify Library](https://aws-amplify.github.io/amplify-js/media/quick_start?platform=purejs)\n- [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)\n- [React](https://reactjs.org/docs/getting-started.html)\n- [Relay](https://facebook.github.io/relay/docs/en/introduction-to-relay.html)\n\n## Launching the AppSync backend\n\nTo run locally, you'll first need to deploy the backend in AWS, like this:\n\n```\naws cloudformation package --template-file backend/template.yml --s3-bucket my-package-bucket \u003e packaged_template.yml\naws cloudformation deploy --template-file packaged_template.yml --stack-name AppSyncRelay --capabilities CAPABILITY_NAMED_IAM\n```\n\nReplace \"my-package-bucket\" with any S3 bucket you want to use to store files required by the CloudFormation stack, such as the GraphQL schema. Note that the `--capabilities` option is required to allow CloudFormation to create IAM roles.\n\nYou can also do this with the `script/deploy` script, which requires setting the `PACKAGE_BUCKET` env var. You can also optionally set `STACK_NAME` for the name of the CloudFormation stack (the default is `AppSyncRelay`). Note that executable scripts in the `script` directory assume a Unix/macOS/Linux environment, Bash, and `jq` are available.\n\n## Running the app locally\n\nTo point the app to the right backend resources, you'll need to set an env var with config info like this:\n```\nAPPSYNC_CONFIG='{\n    \"UserPool\": \"\u003cUserPoolId\u003e\",\n    \"AppSyncEndpoint\": \"\u003cAppSyncEndpoint\u003e\",\n    \"ClientId\": \"\u003cCognito ClientId\u003e\",\n    \"AppSyncRegion\": \"\u003cregion\u003e\"\n  }'\n```\n\nYou can then run the app locally like this:\n\n```\nnpm install\nnpm run serve\n```\n\nThe app will be available at localhost:8080.\n\nTo automatically pull down the appropriate backend configuration from CloudFormation and run the app, you can also use `script/serve`. This requires the `STACK_NAME` env var to be set to the CloudFormation stack name.\n\n## Deploying the frontend as a static site\n\nIf you want to deploy the frontend to the cloud as well, you can host it as a static site on S3. Once you have [configured a bucket appropriately](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html), you can build for production and deploy like this (you will again need backend config information exported in the `APPSYNC_CONFIG` env var as above):\n\n```\nnpm run build\naws s3 sync dist s3://my-static-site-bucket\n```\n\nHere \"my-static-site-bucket\" should be replaced with your S3 bucket configured for static website hosting. You can alternatively use the `script/publish` script, which accepts `STATIC_SITE_BUCKET` as an env var.\n\n## License Summary\n\nThis sample code is made available under a modified MIT license. See the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-appsync-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-archives%2Faws-appsync-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-appsync-relay/lists"}