aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Error: Type "ModelFlightConnection" not found in document #2631

Closed heitorlessa closed 4 years ago

heitorlessa commented 4 years ago

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Deploy Serverless Airline project: amplify init --app https://github.com/aws-samples/aws-serverless-airline-booking
  2. In the schema, remove list queries from type Flight: @model(subscriptions: null, queries: {get: "flight"}) or @model(subscriptions: null, queries: {list: null})
  3. Run locally: amplify mock

Expected behavior

Amplify not to error out, and to remove listFlights query.

Error: Error: Type "ModelFlightConnection" not found in document.

Desktop (please complete the following information):

Additional context

Schema exerpt that works

type Flight 
    @model(subscriptions: null) 
    @key(name: "ByDepartureSchedule", 
        fields: ["departureAirportCode", "arrivalAirportCode", "departureDate"],
        queryField: "getFlightBySchedule")
{
    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!
    seatAllocation: Int!
}
attilah commented 4 years ago

@heitorlessa I think it is a duplicate of #2389, and #2538 will fix it.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.