diff --git a/.graphqlconfig.yml b/.graphqlconfig.yml new file mode 100644 index 00000000..20b9d469 --- /dev/null +++ b/.graphqlconfig.yml @@ -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 diff --git a/amplify/backend/api/awsserverlessairline/parameters.json b/amplify/backend/api/awsserverlessairline/parameters.json new file mode 100644 index 00000000..655280aa --- /dev/null +++ b/amplify/backend/api/awsserverlessairline/parameters.json @@ -0,0 +1,10 @@ +{ + "AppSyncApiName": "awsserverlessairline", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "AuthCognitoUserPoolId": { + "Fn::GetAtt": [ + "authserverlessaairlineauth", + "Outputs.UserPoolId" + ] + } +} \ No newline at end of file diff --git a/amplify/backend/api/awsserverlessairline/schema.graphql b/amplify/backend/api/awsserverlessairline/schema.graphql new file mode 100644 index 00000000..e679acbd --- /dev/null +++ b/amplify/backend/api/awsserverlessairline/schema.graphql @@ -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! +} \ No newline at end of file diff --git a/amplify/backend/api/awsserverlessairline/stacks/CustomResources.json b/amplify/backend/api/awsserverlessairline/stacks/CustomResources.json new file mode 100644 index 00000000..2d8cf0a9 --- /dev/null +++ b/amplify/backend/api/awsserverlessairline/stacks/CustomResources.json @@ -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": "" + } + } +} \ No newline at end of file diff --git a/amplify/backend/backend-config.json b/amplify/backend/backend-config.json index c503d6ba..00ceb32f 100644 --- a/amplify/backend/backend-config.json +++ b/amplify/backend/backend-config.json @@ -4,5 +4,14 @@ "service": "Cognito", "providerPlugin": "awscloudformation" } + }, + "api": { + "awsserverlessairline": { + "service": "AppSync", + "providerPlugin": "awscloudformation", + "output": { + "securityType": "AMAZON_COGNITO_USER_POOLS" + } + } } } \ No newline at end of file diff --git a/src/graphql/mutations.js b/src/graphql/mutations.js new file mode 100644 index 00000000..1b49e55e --- /dev/null +++ b/src/graphql/mutations.js @@ -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 + } +} +`; diff --git a/src/graphql/queries.js b/src/graphql/queries.js new file mode 100644 index 00000000..91d45bc0 --- /dev/null +++ b/src/graphql/queries.js @@ -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 + } +} +`; diff --git a/src/graphql/schema.json b/src/graphql/schema.json new file mode 100644 index 00000000..436a4d39 --- /dev/null +++ b/src/graphql/schema.json @@ -0,0 +1,2326 @@ +{ + "data" : { + "__schema" : { + "queryType" : { + "name" : "Query" + }, + "mutationType" : { + "name" : "Mutation" + }, + "subscriptionType" : { + "name" : "Subscription" + }, + "types" : [ { + "kind" : "OBJECT", + "name" : "Query", + "description" : null, + "fields" : [ { + "name" : "getFlight", + "description" : null, + "args" : [ { + "name" : "id", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "listFlights", + "description" : null, + "args" : [ { + "name" : "filter", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelFlightFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "limit", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "nextToken", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "OBJECT", + "name" : "ModelFlightConnection", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "Flight", + "description" : null, + "fields" : [ { + "name" : "id", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "departureDate", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "departureAirportCode", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "departureAirportName", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "departureCity", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "departureLocale", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "arrivalDate", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "arrivalAirportCode", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "arrivalAirportName", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "arrivalCity", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "arrivalLocale", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ticketPrice", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ticketCurrency", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "flightNumber", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "ID", + "description" : "Built-in ID", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "String", + "description" : "Built-in String", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Int", + "description" : "Built-in Int", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "ModelFlightConnection", + "description" : null, + "fields" : [ { + "name" : "items", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "nextToken", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelFlightFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "id", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelIDFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureDate", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureAirportCode", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureAirportName", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureCity", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureLocale", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalDate", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportCode", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportName", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalCity", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalLocale", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ticketPrice", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelIntFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ticketCurrency", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "flightNumber", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelIntFilterInput", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "and", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelFlightFilterInput", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "or", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelFlightFilterInput", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "not", + "description" : null, + "type" : { + "kind" : "INPUT_OBJECT", + "name" : "ModelFlightFilterInput", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelIDFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "ne", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "eq", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "le", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "lt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ge", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "gt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "contains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "notContains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "between", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "beginsWith", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelStringFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "ne", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "eq", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "le", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "lt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ge", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "gt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "contains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "notContains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "between", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "beginsWith", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelIntFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "ne", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "eq", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "le", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "lt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ge", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "gt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "contains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "notContains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "between", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "Mutation", + "description" : null, + "fields" : [ { + "name" : "createFlight", + "description" : null, + "args" : [ { + "name" : "input", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "INPUT_OBJECT", + "name" : "CreateFlightInput", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "updateFlight", + "description" : null, + "args" : [ { + "name" : "input", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "INPUT_OBJECT", + "name" : "UpdateFlightInput", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "deleteFlight", + "description" : null, + "args" : [ { + "name" : "input", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "INPUT_OBJECT", + "name" : "DeleteFlightInput", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "CreateFlightInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "id", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureDate", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "departureAirportCode", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "departureAirportName", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "departureCity", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "departureLocale", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "arrivalDate", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportCode", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportName", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "arrivalCity", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "arrivalLocale", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "ticketPrice", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "ticketCurrency", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "flightNumber", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "UpdateFlightInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "id", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "departureDate", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureAirportCode", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureAirportName", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureCity", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "departureLocale", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalDate", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportCode", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalAirportName", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalCity", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "arrivalLocale", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ticketPrice", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ticketCurrency", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "flightNumber", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "DeleteFlightInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "id", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "ID", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "Subscription", + "description" : null, + "fields" : [ { + "name" : "onCreateFlight", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "onUpdateFlight", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "onDeleteFlight", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "Flight", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelFloatFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "ne", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "eq", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "le", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "lt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "ge", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "gt", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "contains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "notContains", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "between", + "description" : null, + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Float", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Float", + "description" : "Built-in Float", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "ENUM", + "name" : "ModelSortDirection", + "description" : null, + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : [ { + "name" : "ASC", + "description" : null, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "DESC", + "description" : null, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "possibleTypes" : null + }, { + "kind" : "INPUT_OBJECT", + "name" : "ModelBooleanFilterInput", + "description" : null, + "fields" : null, + "inputFields" : [ { + "name" : "ne", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "eq", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : null + } ], + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Boolean", + "description" : "Built-in Boolean", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__Schema", + "description" : "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.", + "fields" : [ { + "name" : "types", + "description" : "A list of all types supported by this server.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "queryType", + "description" : "The type that query operations will be rooted at.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "mutationType", + "description" : "If this server supports mutation, the type that mutation operations will be rooted at.", + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "directives", + "description" : "'A list of all directives supported by this server.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Directive", + "ofType" : null + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "subscriptionType", + "description" : "'If this server support subscription, the type that subscription operations will be rooted at.", + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__Type", + "description" : null, + "fields" : [ { + "name" : "kind", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "ENUM", + "name" : "__TypeKind", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "fields", + "description" : null, + "args" : [ { + "name" : "includeDeprecated", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : "false" + } ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Field", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "interfaces", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "possibleTypes", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "enumValues", + "description" : null, + "args" : [ { + "name" : "includeDeprecated", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : "false" + } ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__EnumValue", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "inputFields", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ofType", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "ENUM", + "name" : "__TypeKind", + "description" : "An enum describing what kind of type a given __Type is", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : [ { + "name" : "SCALAR", + "description" : "Indicates this type is a scalar.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "OBJECT", + "description" : "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INTERFACE", + "description" : "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "UNION", + "description" : "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM", + "description" : "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_OBJECT", + "description" : "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "LIST", + "description" : "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "NON_NULL", + "description" : "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + } ], + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__Field", + "description" : null, + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "args", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue", + "ofType" : null + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "type", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "isDeprecated", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "deprecationReason", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__InputValue", + "description" : null, + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "type", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "defaultValue", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__EnumValue", + "description" : null, + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "isDeprecated", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "deprecationReason", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__Directive", + "description" : null, + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "locations", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "ENUM", + "name" : "__DirectiveLocation", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "args", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue", + "ofType" : null + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "onOperation", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + }, { + "name" : "onFragment", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + }, { + "name" : "onField", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "ENUM", + "name" : "__DirectiveLocation", + "description" : "An enum describing valid locations where a directive can be placed", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : [ { + "name" : "QUERY", + "description" : "Indicates the directive is valid on queries.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "MUTATION", + "description" : "Indicates the directive is valid on mutations.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FIELD", + "description" : "Indicates the directive is valid on fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FRAGMENT_DEFINITION", + "description" : "Indicates the directive is valid on fragment definitions.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FRAGMENT_SPREAD", + "description" : "Indicates the directive is valid on fragment spreads.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INLINE_FRAGMENT", + "description" : "Indicates the directive is valid on inline fragments.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "SCHEMA", + "description" : "Indicates the directive is valid on a schema SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "SCALAR", + "description" : "Indicates the directive is valid on a scalar SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "OBJECT", + "description" : "Indicates the directive is valid on an object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FIELD_DEFINITION", + "description" : "Indicates the directive is valid on a field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ARGUMENT_DEFINITION", + "description" : "Indicates the directive is valid on a field argument SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INTERFACE", + "description" : "Indicates the directive is valid on an interface SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "UNION", + "description" : "Indicates the directive is valid on an union SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM", + "description" : "Indicates the directive is valid on an enum SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM_VALUE", + "description" : "Indicates the directive is valid on an enum value SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_OBJECT", + "description" : "Indicates the directive is valid on an input object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_FIELD_DEFINITION", + "description" : "Indicates the directive is valid on an input object field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + } ], + "possibleTypes" : null + } ], + "directives" : [ { + "name" : "include", + "description" : "Directs the executor to include this field or fragment only when the `if` argument is true", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], + "args" : [ { + "name" : "if", + "description" : "Included when true.", + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : true, + "onField" : true + }, { + "name" : "skip", + "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], + "args" : [ { + "name" : "if", + "description" : "Skipped when true.", + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : true, + "onField" : true + }, { + "name" : "defer", + "description" : "This directive allows results to be deferred during execution", + "locations" : [ "FIELD" ], + "args" : [ ], + "onOperation" : false, + "onFragment" : false, + "onField" : true + }, { + "name" : "aws_auth", + "description" : "Directs the schema to enforce authorization on a field", + "locations" : [ "FIELD_DEFINITION" ], + "args" : [ { + "name" : "cognito_groups", + "description" : "List of cognito user pool groups which have access on this field", + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : false, + "onField" : false + }, { + "name" : "aws_publish", + "description" : "Tells the service which subscriptions will be published to when this mutation is called. This directive is deprecated use @aws_susbscribe directive instead.", + "locations" : [ "FIELD_DEFINITION" ], + "args" : [ { + "name" : "subscriptions", + "description" : "List of subscriptions which will be published to when this mutation is called.", + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : false, + "onField" : false + }, { + "name" : "aws_subscribe", + "description" : "Tells the service which mutation triggers this subscription.", + "locations" : [ "FIELD_DEFINITION" ], + "args" : [ { + "name" : "mutations", + "description" : "List of mutations which will trigger this subscription when they are called.", + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : false, + "onField" : false + }, { + "name" : "deprecated", + "description" : null, + "locations" : [ "FIELD_DEFINITION", "ENUM_VALUE" ], + "args" : [ { + "name" : "reason", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : "\"No longer supported\"" + } ], + "onOperation" : false, + "onFragment" : false, + "onField" : false + } ] + } + } +} \ No newline at end of file diff --git a/src/graphql/subscriptions.js b/src/graphql/subscriptions.js new file mode 100644 index 00000000..410804ff --- /dev/null +++ b/src/graphql/subscriptions.js @@ -0,0 +1,60 @@ +// eslint-disable +// this is an auto generated file. This will be overwritten + +export const onCreateFlight = `subscription OnCreateFlight { + onCreateFlight { + id + departureDate + departureAirportCode + departureAirportName + departureCity + departureLocale + arrivalDate + arrivalAirportCode + arrivalAirportName + arrivalCity + arrivalLocale + ticketPrice + ticketCurrency + flightNumber + } +} +`; +export const onUpdateFlight = `subscription OnUpdateFlight { + onUpdateFlight { + id + departureDate + departureAirportCode + departureAirportName + departureCity + departureLocale + arrivalDate + arrivalAirportCode + arrivalAirportName + arrivalCity + arrivalLocale + ticketPrice + ticketCurrency + flightNumber + } +} +`; +export const onDeleteFlight = `subscription OnDeleteFlight { + onDeleteFlight { + id + departureDate + departureAirportCode + departureAirportName + departureCity + departureLocale + arrivalDate + arrivalAirportCode + arrivalAirportName + arrivalCity + arrivalLocale + ticketPrice + ticketCurrency + flightNumber + } +} +`; diff --git a/src/store/catalog/actions.js b/src/store/catalog/actions.js index 150373f4..6eae561f 100644 --- a/src/store/catalog/actions.js +++ b/src/store/catalog/actions.js @@ -1,5 +1,6 @@ import Flight from "../../shared/models/FlightClass"; -import axios from "axios"; +import { API, graphqlOperation } from "aws-amplify"; +import { listFlights, getFlight } from "../../graphql/queries"; /** * @@ -30,37 +31,55 @@ import axios from "axios"; * this.filteredFlights = this.sortByDeparture(this.flights); * } */ -export function fetchFlights({ commit }, { date, departure, arrival }) { - return new Promise(async (resolve, reject) => { - commit("SET_LOADER", true); - try { - const { data: flightData } = await axios.get("/mocks/flights.json"); - const flights = flightData.map(flight => new Flight(flight)); +export async function fetchFlights({ commit }, { date, departure, arrival }) { + commit("SET_LOADER", true); + try { + // listFlights query filter + const flightFilter = { + filter: { + departureDate: { + beginsWith: date + }, + departureAirportCode: { + eq: departure + }, + arrivalAirportCode: { + eq: arrival + } + } + }; + + const { + // @ts-ignore + data: { + listFlights: { items: flightData } + } + } = await API.graphql(graphqlOperation(listFlights, flightFilter)); - commit("SET_FLIGHTS", flights); - commit("SET_LOADER", false); - resolve(); - } catch (error) { - console.error(error); - commit("SET_LOADER", false); - reject(error); - } - }); + // data mutations happen within a Flight class + // here we convert graphQL results into an array of Flights + // before comitting to Vuex State Management + const flights = flightData.map(flight => new Flight(flight)); + + commit("SET_FLIGHTS", flights); + commit("SET_LOADER", false); + } catch (error) { + console.error(error); + commit("SET_LOADER", false); + throw error; + } } /** * - * Catalog [Vuex Module Action](https://vuex.vuejs.org/guide/actions.html) - fetchByFlightNumber retrieves a flight given a flight number identification from Catalog service. + * Catalog [Vuex Module Action](https://vuex.vuejs.org/guide/actions.html) - fetchByFlightId retrieves a unique flight from Catalog service. Flight Number may be reused but not ID. * * Similarly to fetchFlights, it also controls Flight Loader when fetching data from Catalog service. * * **NOTE**: It doesn't mutate the store * @param {object} context - Vuex action context (context.commit, context.getters, context.state, context.dispatch) * @param {object} obj - Object containing params to filter flights from catalog - * @param {Date} obj.date - Date in DD-MM-YYYY format - * @param {string} obj.departure - Airport IATA to be filtered as departure - * @param {string} obj.arrival - Airport IATA to be filtered as arrival - * @param {number} obj.flightNumber - Flight Number + * @param {string} obj.flightId - Flight Unique Identifier * @returns {promise} - Promise representing flight from Catalog service. * @see {@link SET_LOADER} for more info on mutation * @example @@ -68,34 +87,27 @@ export function fetchFlights({ commit }, { date, departure, arrival }) { * async beforeMount() { * if (this.isAuthenticated) { * if (!this.flight) { - * this.selectedFlight = await this.$store.dispatch("catalog/fetchByFlightNumber", { - * date: this.date, - * departure: this.departure, - * arrival: this.arrival, - * flightNumber: parseInt(this.flightNumber) + * this.selectedFlight = await this.$store.dispatch("catalog/fetchByFlightId", { + * flightId: this.flightId * }); * } * } * }, */ -export function fetchByFlightNumber( - { commit }, - { date, departure, arrival, flightNumber } -) { - return new Promise(async (resolve, reject) => { - try { - commit("SET_LOADER", true); - const { data: flightData } = await axios.get("/mocks/flights.json"); - const flight = new Flight( - flightData.find(flight => flight.flightNumber === flightNumber) - ); +export async function fetchByFlightId({ commit }, { flightId }) { + try { + commit("SET_LOADER", true); + const { + // @ts-ignore + data: { getFlight: flightData } + } = await API.graphql(graphqlOperation(getFlight, { id: flightId })); - commit("SET_LOADER", false); - resolve(flight); - } catch (error) { - console.error(error); - commit("SET_LOADER", false); - reject(error); - } - }); + const flight = new Flight(flightData); + commit("SET_LOADER", false); + return flight; + } catch (error) { + console.error(error); + commit("SET_LOADER", false); + throw error; + } } diff --git a/src/views/FlightResults.vue b/src/views/FlightResults.vue index 6aa77846..4480bd55 100644 --- a/src/views/FlightResults.vue +++ b/src/views/FlightResults.vue @@ -91,7 +91,7 @@ :to="{ name: 'selectedFlight', params: { flight: flight }, - query: { flightNumber: flight.flightNumber, date, departure, arrival } + query: { flightId: flight.id } }" v-for="flight in filteredFlights" :key="flight.id" diff --git a/src/views/FlightSelection.vue b/src/views/FlightSelection.vue index b3a7ed13..97ed5d53 100644 --- a/src/views/FlightSelection.vue +++ b/src/views/FlightSelection.vue @@ -118,16 +118,11 @@ export default { name: "FlightSelection", /** * @param {Flight} flight - Selected Flight - * @param {number} flightNumber - Selected Flight Number - * @param {string} date - Selected departure date - * @param {string} date - Selected arrival date + * @param {string} flightId - Selected Flight Unique Identifier */ props: { flight: { type: FlightClass }, - flightNumber: { type: [Number, String], required: true }, // depending on browser flightNumber may come as string - date: { type: String, required: true }, - departure: { type: String, required: true }, - arrival: { type: String, required: true } + flightId: { type: String, required: true } }, components: { FlightCard, @@ -168,12 +163,9 @@ export default { if (this.isAuthenticated) { if (!this.flight) { this.selectedFlight = await this.$store.dispatch( - "catalog/fetchByFlightNumber", + "catalog/fetchByFlightId", { - date: this.date, - departure: this.departure, - arrival: this.arrival, - flightNumber: parseInt(this.flightNumber) + flightId: this.flightId } ); } diff --git a/src/views/Search.vue b/src/views/Search.vue index 00dd256a..8e7393dc 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -157,7 +157,7 @@ export default { this.$router.push({ name: "searchResults", query: { - date: date.formatDate(this.departureDate, "DD-MM-YYYY"), + date: date.formatDate(this.departureDate, "YYYY-MM-DD"), departure: this.departureCity, arrival: this.arrivalCity }