amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Custom Mutation/Query functions are not showing up under the client type

Open ideen1 opened this issue 10 months ago • 4 comments

Environment information

System:
  OS: macOS 13.6.6
  CPU: (10) arm64 Apple M1 Pro
  Memory: 167.00 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.10.0 - /usr/local/bin/node
  Yarn: 1.22.22 - /usr/local/bin/yarn
  npm: 10.2.3 - /usr/local/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/backend: 0.13.0
  @aws-amplify/backend-cli: 0.12.0
  aws-amplify: 6.0.28
  aws-cdk: Not Found
  aws-cdk-lib: 2.138.0
  typescript: 5.4.5
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

When adding custom mutations/queries to the schema, their types do not appear under client.mutations or client.queries. They still work, when you call on them, however the types are not there which causes TypeScript errors. This occurred after I updated from amplify-backend version 0.13.0-beta6 to 0.13.0. let me know if you can't reproduce and I can provide more code.

ideen1 avatar Apr 21 '24 01:04 ideen1

Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂

ykethan avatar Apr 22 '24 15:04 ykethan

Hey @ideen1, Thanks for raising this. Can you please update your backend and backend-cli lib to latest and try again?

AnilMaktala avatar Apr 24 '24 00:04 AnilMaktala

Hey @AnilMaktala, I have updated both and reloaded my dev environment. Still encountering the same issue unfortunately.

ideen1 avatar Apr 24 '24 04:04 ideen1

@ideen1 could you please try upgrading the following 3 dependencies to the following versions:

"dependencies": {
  "aws-amplify": "^6.2.0",
   ...
},
"devDependencies": {
  "@aws-amplify/backend": "^1.0.0",
  "@aws-amplify/backend-cli": "^1.0.0",
  ...
}

If that doesn't fix the issue, please share your schema and client code.

iartemiev avatar May 02 '24 21:05 iartemiev

Hi @ideen1, Are you still experiencing this issue?

AnilMaktala avatar May 07 '24 15:05 AnilMaktala

Hey 👋 , This issue is being closed due to inactivity. If you are still experiencing the same problem and need further assistance, please feel free to leave a comment. This will enable us to reopen the issue and provide you with the necessary support.

AnilMaktala avatar May 20 '24 01:05 AnilMaktala

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar May 20 '24 01:05 github-actions[bot]