Skip to content

Commit

Permalink
Merge pull request #3 from heitorlessa/twitch
Browse files Browse the repository at this point in the history
EP2 - Catalog Service
  • Loading branch information
heitorlessa authored May 3, 2019
2 parents 2aeaaa7 + 8c16109 commit 94cdcd4
Show file tree
Hide file tree
Showing 13 changed files with 2,670 additions and 59 deletions.
16 changes: 16 additions & 0 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
projects:
awsserverlessairline:
schemaPath: src/graphql/schema.json
includes:
- src/graphql/**/*.js
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: javascript
generatedFileName: ''
docsFilePath: src/graphql
graphQLApiId: p3jpzjnkcjfnnjs2qcd7rafkum
endpoints:
prod: >-
https://2byom2uph5gpzixmozba5rdsky.appsync-api.eu-west-1.amazonaws.com/graphql
10 changes: 10 additions & 0 deletions amplify/backend/api/awsserverlessairline/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"AppSyncApiName": "awsserverlessairline",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"AuthCognitoUserPoolId": {
"Fn::GetAtt": [
"authserverlessaairlineauth",
"Outputs.UserPoolId"
]
}
}
17 changes: 17 additions & 0 deletions amplify/backend/api/awsserverlessairline/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

type Flight @model {
id: ID!
departureDate: String!
departureAirportCode: String!
departureAirportName: String!
departureCity: String!
departureLocale: String!
arrivalDate: String!
arrivalAirportCode: String!
arrivalAirportName: String!
arrivalCity: String!
arrivalLocale: String!
ticketPrice: Int!
ticketCurrency: String!
flightNumber: Int!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
}
},
"Resources": {
"EmptyResource": {
"Type": "Custom::EmptyResource",
"Condition": "AlwaysFalse"
}
},
"Conditions": {
"HasEnvironmentParameter": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
]
},
"AlwaysFalse": {
"Fn::Equals": [
"true",
"false"
]
}
},
"Outputs": {
"EmptyOutput": {
"Description": "An empty output. You may delete this if you have at least one resource above.",
"Value": ""
}
}
}
9 changes: 9 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
"service": "Cognito",
"providerPlugin": "awscloudformation"
}
},
"api": {
"awsserverlessairline": {
"service": "AppSync",
"providerPlugin": "awscloudformation",
"output": {
"securityType": "AMAZON_COGNITO_USER_POOLS"
}
}
}
}
60 changes: 60 additions & 0 deletions src/graphql/mutations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// eslint-disable
// this is an auto generated file. This will be overwritten

export const createFlight = `mutation CreateFlight($input: CreateFlightInput!) {
createFlight(input: $input) {
id
departureDate
departureAirportCode
departureAirportName
departureCity
departureLocale
arrivalDate
arrivalAirportCode
arrivalAirportName
arrivalCity
arrivalLocale
ticketPrice
ticketCurrency
flightNumber
}
}
`;
export const updateFlight = `mutation UpdateFlight($input: UpdateFlightInput!) {
updateFlight(input: $input) {
id
departureDate
departureAirportCode
departureAirportName
departureCity
departureLocale
arrivalDate
arrivalAirportCode
arrivalAirportName
arrivalCity
arrivalLocale
ticketPrice
ticketCurrency
flightNumber
}
}
`;
export const deleteFlight = `mutation DeleteFlight($input: DeleteFlightInput!) {
deleteFlight(input: $input) {
id
departureDate
departureAirportCode
departureAirportName
departureCity
departureLocale
arrivalDate
arrivalAirportCode
arrivalAirportName
arrivalCity
arrivalLocale
ticketPrice
ticketCurrency
flightNumber
}
}
`;
48 changes: 48 additions & 0 deletions src/graphql/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// eslint-disable
// this is an auto generated file. This will be overwritten

export const getFlight = `query GetFlight($id: ID!) {
getFlight(id: $id) {
id
departureDate
departureAirportCode
departureAirportName
departureCity
departureLocale
arrivalDate
arrivalAirportCode
arrivalAirportName
arrivalCity
arrivalLocale
ticketPrice
ticketCurrency
flightNumber
}
}
`;
export const listFlights = `query ListFlights(
$filter: ModelFlightFilterInput
$limit: Int
$nextToken: String
) {
listFlights(filter: $filter, limit: $limit, nextToken: $nextToken) {
items {
id
departureDate
departureAirportCode
departureAirportName
departureCity
departureLocale
arrivalDate
arrivalAirportCode
arrivalAirportName
arrivalCity
arrivalLocale
ticketPrice
ticketCurrency
flightNumber
}
nextToken
}
}
`;
Loading

0 comments on commit 94cdcd4

Please sign in to comment.