Skip to content

Commit 94cdcd4

Browse files
authored
Merge pull request #3 from heitorlessa/twitch
EP2 - Catalog Service
2 parents 2aeaaa7 + 8c16109 commit 94cdcd4

File tree

13 files changed

+2670
-59
lines changed

13 files changed

+2670
-59
lines changed

.graphqlconfig.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
projects:
2+
awsserverlessairline:
3+
schemaPath: src/graphql/schema.json
4+
includes:
5+
- src/graphql/**/*.js
6+
excludes:
7+
- ./amplify/**
8+
extensions:
9+
amplify:
10+
codeGenTarget: javascript
11+
generatedFileName: ''
12+
docsFilePath: src/graphql
13+
graphQLApiId: p3jpzjnkcjfnnjs2qcd7rafkum
14+
endpoints:
15+
prod: >-
16+
https://2byom2uph5gpzixmozba5rdsky.appsync-api.eu-west-1.amazonaws.com/graphql
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"AppSyncApiName": "awsserverlessairline",
3+
"DynamoDBBillingMode": "PAY_PER_REQUEST",
4+
"AuthCognitoUserPoolId": {
5+
"Fn::GetAtt": [
6+
"authserverlessaairlineauth",
7+
"Outputs.UserPoolId"
8+
]
9+
}
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
type Flight @model {
3+
id: ID!
4+
departureDate: String!
5+
departureAirportCode: String!
6+
departureAirportName: String!
7+
departureCity: String!
8+
departureLocale: String!
9+
arrivalDate: String!
10+
arrivalAirportCode: String!
11+
arrivalAirportName: String!
12+
arrivalCity: String!
13+
arrivalLocale: String!
14+
ticketPrice: Int!
15+
ticketCurrency: String!
16+
flightNumber: Int!
17+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"AWSTemplateFormatVersion": "2010-09-09",
3+
"Description": "An auto-generated nested stack.",
4+
"Metadata": {},
5+
"Parameters": {
6+
"AppSyncApiId": {
7+
"Type": "String",
8+
"Description": "The id of the AppSync API associated with this project."
9+
},
10+
"AppSyncApiName": {
11+
"Type": "String",
12+
"Description": "The name of the AppSync API",
13+
"Default": "AppSyncSimpleTransform"
14+
},
15+
"env": {
16+
"Type": "String",
17+
"Description": "The environment name. e.g. Dev, Test, or Production",
18+
"Default": "NONE"
19+
},
20+
"S3DeploymentBucket": {
21+
"Type": "String",
22+
"Description": "The S3 bucket containing all deployment assets for the project."
23+
},
24+
"S3DeploymentRootKey": {
25+
"Type": "String",
26+
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
27+
}
28+
},
29+
"Resources": {
30+
"EmptyResource": {
31+
"Type": "Custom::EmptyResource",
32+
"Condition": "AlwaysFalse"
33+
}
34+
},
35+
"Conditions": {
36+
"HasEnvironmentParameter": {
37+
"Fn::Not": [
38+
{
39+
"Fn::Equals": [
40+
{
41+
"Ref": "env"
42+
},
43+
"NONE"
44+
]
45+
}
46+
]
47+
},
48+
"AlwaysFalse": {
49+
"Fn::Equals": [
50+
"true",
51+
"false"
52+
]
53+
}
54+
},
55+
"Outputs": {
56+
"EmptyOutput": {
57+
"Description": "An empty output. You may delete this if you have at least one resource above.",
58+
"Value": ""
59+
}
60+
}
61+
}

amplify/backend/backend-config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,14 @@
44
"service": "Cognito",
55
"providerPlugin": "awscloudformation"
66
}
7+
},
8+
"api": {
9+
"awsserverlessairline": {
10+
"service": "AppSync",
11+
"providerPlugin": "awscloudformation",
12+
"output": {
13+
"securityType": "AMAZON_COGNITO_USER_POOLS"
14+
}
15+
}
716
}
817
}

src/graphql/mutations.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// eslint-disable
2+
// this is an auto generated file. This will be overwritten
3+
4+
export const createFlight = `mutation CreateFlight($input: CreateFlightInput!) {
5+
createFlight(input: $input) {
6+
id
7+
departureDate
8+
departureAirportCode
9+
departureAirportName
10+
departureCity
11+
departureLocale
12+
arrivalDate
13+
arrivalAirportCode
14+
arrivalAirportName
15+
arrivalCity
16+
arrivalLocale
17+
ticketPrice
18+
ticketCurrency
19+
flightNumber
20+
}
21+
}
22+
`;
23+
export const updateFlight = `mutation UpdateFlight($input: UpdateFlightInput!) {
24+
updateFlight(input: $input) {
25+
id
26+
departureDate
27+
departureAirportCode
28+
departureAirportName
29+
departureCity
30+
departureLocale
31+
arrivalDate
32+
arrivalAirportCode
33+
arrivalAirportName
34+
arrivalCity
35+
arrivalLocale
36+
ticketPrice
37+
ticketCurrency
38+
flightNumber
39+
}
40+
}
41+
`;
42+
export const deleteFlight = `mutation DeleteFlight($input: DeleteFlightInput!) {
43+
deleteFlight(input: $input) {
44+
id
45+
departureDate
46+
departureAirportCode
47+
departureAirportName
48+
departureCity
49+
departureLocale
50+
arrivalDate
51+
arrivalAirportCode
52+
arrivalAirportName
53+
arrivalCity
54+
arrivalLocale
55+
ticketPrice
56+
ticketCurrency
57+
flightNumber
58+
}
59+
}
60+
`;

src/graphql/queries.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// eslint-disable
2+
// this is an auto generated file. This will be overwritten
3+
4+
export const getFlight = `query GetFlight($id: ID!) {
5+
getFlight(id: $id) {
6+
id
7+
departureDate
8+
departureAirportCode
9+
departureAirportName
10+
departureCity
11+
departureLocale
12+
arrivalDate
13+
arrivalAirportCode
14+
arrivalAirportName
15+
arrivalCity
16+
arrivalLocale
17+
ticketPrice
18+
ticketCurrency
19+
flightNumber
20+
}
21+
}
22+
`;
23+
export const listFlights = `query ListFlights(
24+
$filter: ModelFlightFilterInput
25+
$limit: Int
26+
$nextToken: String
27+
) {
28+
listFlights(filter: $filter, limit: $limit, nextToken: $nextToken) {
29+
items {
30+
id
31+
departureDate
32+
departureAirportCode
33+
departureAirportName
34+
departureCity
35+
departureLocale
36+
arrivalDate
37+
arrivalAirportCode
38+
arrivalAirportName
39+
arrivalCity
40+
arrivalLocale
41+
ticketPrice
42+
ticketCurrency
43+
flightNumber
44+
}
45+
nextToken
46+
}
47+
}
48+
`;

0 commit comments

Comments
 (0)