Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"SomeInput" is not present when resolving type "OtherInput" #3053

Open
dhenze opened this issue Nov 27, 2024 · 1 comment
Open

"SomeInput" is not present when resolving type "OtherInput" #3053

dhenze opened this issue Nov 27, 2024 · 1 comment
Assignees
Labels
data-schema Gen 2 pending-community-response Issue is pending a response from the author or community. RDS to-be-reproduced Pending reproduction

Comments

@dhenze
Copy link

dhenze commented Nov 27, 2024

Environment information

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 295.63 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
  Yarn: 1.22.22 - ~/.nvm/versions/node/v18.19.1/bin/yarn
  npm: 10.9.1 - ~/.nvm/versions/node/v18.19.1/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.5.0
  @aws-amplify/backend: 1.8.0
  @aws-amplify/backend-auth: 1.4.1
  @aws-amplify/backend-cli: 1.4.2
  @aws-amplify/backend-data: 1.2.1
  @aws-amplify/backend-deployer: 1.1.10
  @aws-amplify/backend-function: 1.8.0
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.3
  @aws-amplify/backend-secret: 1.1.5
  @aws-amplify/backend-storage: 1.2.3
  @aws-amplify/cli-core: 1.2.0
  @aws-amplify/client-config: 1.5.2
  @aws-amplify/deployed-backend-client: 1.4.2
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.9
  @aws-amplify/platform-core: 1.2.2
  @aws-amplify/plugin-types: 1.5.0
  @aws-amplify/sandbox: 1.2.6
  @aws-amplify/schema-generator: 1.2.5
  aws-amplify: 6.10.0
  aws-cdk: 2.171.0
  aws-cdk-lib: 2.171.0
  typescript: 5.7.2
No AWS environment variables
No CDK environment variables

Data packages

[email protected] /Users/daniel/workspace/event_survey
├─┬ @aws-amplify/[email protected]
│ └─┬ @aws-amplify/[email protected]
│   └── @aws-amplify/[email protected]
└─┬ @aws-amplify/[email protected]
  └─┬ @aws-amplify/[email protected]
    └── @aws-amplify/[email protected]

Description

We are building an amplify Gen2 app based on a SQL RDS data source. Recently I did an update to the schema, regenerated the schema.sql.ts file and pushed the changes to git. The deployment for that branch started and failed with these errors:

The input value type 'SurveyResponseInput' is not present when resolving type 'CreatePersonInput'
The input value type 'PersonInput' is not present when resolving type 'CreateSurveyResponseInput'

There seems to be some circular dependency that I could not resolve yet.

I have set the relationships in resource.ts as follows:

  .setRelationships((models: any) => [
    models.Person.relationships({
      survey_responses: a.hasMany("SurveyResponse", "person_id"),
    }),
    models.SurveyResponse.relationships({
      person: a.belongsTo("Person", "person_id")
    })
  ])

I have setup the amplify app from scratch and without the above code snippet could deploy successfully.

The schema.sql.ts generated from the DB:

.schema({
    "person": a.model({
        id: a.integer().default(),
        account: a.string(),
        name: a.string(),
        email: a.string().required(),
        created_at: a.datetime(),
        sylius_customer_id: a.integer()
    }).identifier([
        "id"
    ]),
    "surveyresponse": a.model({
        id: a.integer().default(),
        account: a.string().required(),
        person_id: a.integer(),
        survey_type: a.string(),
        score: a.integer().required(),
        comment: a.string(),
        permalink: a.string(),
        created_at: a.datetime(),
        updated_at: a.datetime(),
        artnight_id: a.integer(),
        artnight: a.string().required(),
        artist: a.string().required(),
        pimcore_order_id: a.integer(),
        nkeeper_event_id: a.integer(),
        nkeeper_host_id: a.integer(),
        nkeeper_theme_id: a.integer(),
        nkeeper_venue_id: a.integer(),
        host_score: a.integer(),
        venue_score: a.integer(),
        theme_score: a.integer(),
        host_comment: a.string(),
        venue_comment: a.string(),
        theme_comment: a.string(),
        publish: a.boolean(),
        sylius_order_id: a.integer()
    }).identifier([
        "id"
    ])
});
@chrisbonifacio
Copy link
Member

chrisbonifacio commented Dec 16, 2024

Hi @dhenze thanks for raising this issue. I will try to reproduce and reply with any findings.

In the meantime, can you please make sure that you have the latest versions of amplify backend packages installed?
This issue seems familiar so this might help resolve this issue if it has been resolved already.

You can update them by running

npm i @aws-amplify/backend@latest @aws-amplify/backend-cli@latest

lastly, please also update the nested @aws-amplify/data-schema package by running:

npm update @aws-amplify/data-schema

Let me know if that helps!

@chrisbonifacio chrisbonifacio added pending-maintainer-response Issue is pending a response from the Amplify team. pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-schema Gen 2 pending-community-response Issue is pending a response from the author or community. RDS to-be-reproduced Pending reproduction
Projects
None yet
Development

No branches or pull requests

4 participants