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

Custom mutation is not generating models on iOS

Open maziarzamani opened this issue 3 years ago • 6 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?

v15.5.1

Amplify CLI Version

6.3.0

What operating system are you using?

Mac

Amplify Categories

auth, api

Amplify Commands

codegen

Describe the bug

When adding a custom mutation the amplify cli for iOS does not generate models for them.

Expected behavior

I was expecting that models for all operations would be created automatically. The folder only contains models for model.

Reproduction steps

  1. Add a custom mutation
  2. Apply the resolvers
  3. Update the CustomResources.json
  4. Push

GraphQL schema(s)

type Mutation {
   batchCreateEvents(events: [CreateEventInput]): [Event]
}

type Event
  @model
  @auth(rules: [{ allow: owner, ownerField: "owner" }]) {
  id: ID!
  owner: String
}


Log output

# Put your logs below this line


Additional information

No response

maziarzamani avatar Oct 20 '21 12:10 maziarzamani

Transferring to the codegen team

marcvberg avatar Oct 25 '21 21:10 marcvberg

Hi @maziarzamani,

Modelgen does not support generating models for custom models.

dpilch avatar Oct 27 '21 14:10 dpilch

Hi @maziarzamani,

Modelgen does not support generating models for custom models.

I did realize that, however I was wondering if it was someting that could be implemented/requested?

maziarzamani avatar Oct 27 '21 14:10 maziarzamani

Yes, we can log this as a feature request.

dpilch avatar Oct 27 '21 15:10 dpilch

Thanks @dpilch

maziarzamani avatar Oct 27 '21 17:10 maziarzamani

What is the workaround for this?

maziarzamani avatar Jan 25 '22 10:01 maziarzamani