amplify-codegen icon indicating copy to clipboard operation
amplify-codegen copied to clipboard

Unable to generate operations.graphql

Open charlieforward9 opened this issue 1 year ago • 0 comments

Before opening, please confirm:

  • [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

20.9.0

Amplify CLI Version

12.11.1

What operating system are you using?

Mac

Amplify Codegen Command

other codegen <subcommand> (please mention in the issue)

Describe the bug

I would like to efficiently generate RTK Query hooks for my Amplify application using this tool.

I have not been able to figure out how to generate the code that belongs in the operations.graphql input. In other word, the files that are generated with amplify codegen statements but without the Typescript wrapped around.

Screenshot 2024-05-06 at 11 20 39 PM

Maybe I am missing a simple command, but if not it would be really helpful to have this as a codegen statement...

Expected behavior

Screenshot 2024-05-06 at 11 56 26 PM

The output I expect is the useGetAccountQuery, but properly typed with the queries definition found in graphql/queries.ts, but without the typescript wrapping it.

Screenshot 2024-05-06 at 11 25 31 PM

I would like to have an option to access these statements in their graphql syntax within my codebase via this codegen package.

Reproduction steps

  1. Install this lib
  2. Try to get a single graphql file with all of the operations the schema offers.

charlieforward9 avatar May 07 '24 03:05 charlieforward9