Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.12.1
Amplify CLI Version
12.14.2
What operating system are you using?
Mac
Amplify Codegen Command
codegen
Describe the bug
Generated types of nested arrays of a custom type are not correct.
Say I have this in my schema.graphql
type Foo {
nestedArray: [[Bar!]!]!
}
type Bar {
bool: Boolean
}
and I run amplify codegen, I get the following in API.ts
export type Foo = {
nestedArray: Array<{
__typename: "Bar";
bool?: boolean | null;
}>;
}
export type Bar = {
__typename: "Bar";
bool?: boolean | null;
};
Expected behavior
export type Foo = {
nestedArray: Array< Array<{
__typename: "Bar";
bool?: boolean | null;
}> >;
}
export type Bar = {
__typename: "Bar";
bool?: boolean | null;
};
Reproduction steps
- Add this to schema.graphql
type Foo {
nestedArray: [[Bar!]!]!
}
type Bar {
bool: Boolean
}
- Run
amplify codegen
- See generated types in API.ts
GraphQL schema(s)
Details
type Foo {
nestedArray: [[Bar!]!]!
}
type Bar {
bool: Boolean
}
Log output
Details
# Put your logs below this line
Additional information
Nested arrays of primitive types are being generated fine. Running codegen on
type Foo {
nestedArray: [[String!]!]!
}
I get
export type Foo = {
nestedArray: Array<Array<string>>;
}
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.12.1
Amplify CLI Version
12.14.2
What operating system are you using?
Mac
Amplify Codegen Command
codegen
Describe the bug
Generated types of nested arrays of a custom type are not correct.
Say I have this in my
schema.graphqland I run amplify codegen, I get the following in API.ts
Expected behavior
Reproduction steps
amplify codegenGraphQL schema(s)
Details
Log output
Details
Additional information
Nested arrays of primitive types are being generated fine. Running codegen on
I get