-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
transferredIssue has been transferred from another Amplify repositoryIssue has been transferred from another Amplify repository
Description
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
21.2.0
Amplify CLI Version
12.8.2
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
I am able to use amplify codegen in a non-amplify directory with 12.4.0 but not with 12.8.2.
I developed a cloud backend with AWS CDK and deployed an appsync graphql api. I would like to use that api in my swift project on iOS.
When running amplify codegen on 12.4.0, the API.swift file generates fine from my schema.graphql
When running amplify codegen on 12.8.2, an error is generated:
Syntax Error: Unexpected <EOF> (4:1)
2 |
3 |
> 4 |
| ^
My schema.graphql looks like the following:
type Bundle {
bundleId: ID!
imageUrl: String
metadata: String
assets: S3Object
}
type S3Object {
bucket: String!
region: String!
key: String!
localUri: String!
mimeType: String!
}
input CreateBundleInput {
imageUrl: String!
metadata: String!
assets: S3ObjectInput
}
input S3ObjectInput {
bucket: String!
region: String!
key: String!
localUri: String!
mimeType: String!
}
type Query {
getBundleById(bundleId: ID!): Bundle
}
type Mutation {
createBundle(input: CreateBundleInput!): Bundle
}
If this isn't proper usage, would anyone be able to kindly guide me?
Expected behavior
amplify codegen should generate an API.swift file
Reproduction steps
- Install the amplify cli using
npm install -g @aws-amplify/cli - In a new directory, add this schema.graphql file:
type Bundle {
bundleId: ID!
imageUrl: String
metadata: String
assets: S3Object
}
type S3Object {
bucket: String!
region: String!
key: String!
localUri: String!
mimeType: String!
}
input CreateBundleInput {
imageUrl: String!
metadata: String!
assets: S3ObjectInput
}
input S3ObjectInput {
bucket: String!
region: String!
key: String!
localUri: String!
mimeType: String!
}
type Query {
getBundleById(bundleId: ID!): Bundle
}
type Mutation {
createBundle(input: CreateBundleInput!): Bundle
}
- Run amplify codegen add. Select 'ios', and use the defaults for the questions that follow.
Project Identifier
No response
Log output
Details
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
Jaff5090
Metadata
Metadata
Assignees
Labels
transferredIssue has been transferred from another Amplify repositoryIssue has been transferred from another Amplify repository