Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shashitnak committed May 29, 2024
0 parents commit 485f261
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on: [push]

jobs:
deploy_tailcall:
runs-on: ubuntu-latest
name: Deploy Tailcall
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy Tailcall
id: deploy-tailcall
uses: tailcallhq/[email protected]
with:
# mandatory
provider: '<cloud-provider>' # currently 'aws' and 'fly' are supported
tailcall-config: 'config.graphql'

# when deploying to aws
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-east-1"
aws-iam-role: "iam_for_tailcall"
terraform-api-token: ${{ secrets.TERRAFORM_API_TOKEN }}

# when deploying to fly
fly-api-token: ${{ secrets.FLY_API_TOKEN }}
fly-app-name: "tailcall"
fly-region: "lax"
28 changes: 28 additions & 0 deletions config.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
schema
@server(port: 8000, headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}})
@upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: 42, batch: {delay: 100}) {
query: Query
}

type Query {
posts: [Post] @http(path: "/posts")
users: [User] @http(path: "/users")
user(id: Int!): User @http(path: "/users/{{.args.id}}")
}

type User {
id: Int!
name: String!
username: String!
email: String!
phone: String
website: String
}

type Post {
id: Int!
userId: Int!
title: String!
body: String!
user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}])
}

0 comments on commit 485f261

Please sign in to comment.