You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In one of our upcoming projects, my team is going to use CDK TypeScript, AppSync, nodeJS Lambda, TypeORM as Layer and Provisioned Aurora as the tech stack.
At the time of POC, we created
(1) AppSync schema using code-first approach,
(2) TypeORM entities using annotations
(3) connected lambda to database using TypeORM repository commands
One of the observations was redundancy in the declared schema/entity fields.
Example
// This is TypeORM entity
@Entity()
export class Rate {
@Column()
name: string;
@Column({ type: "int" })
value: number;
}
// This is code first ObjectType creation.
new ObjectType(`Rate`, {
definition: {
name: STRING({ isRequired: true }),
value: INT({ isRequired: true }),
},
directives: [DIRECTIVE_API_KEY]
})
Notice duplication of Rate object and member fields above. For each new field added to TypeORM Rate entity, we need to add it to the ObjectType created below.
Question: Is it possible to generate AppSync schema using annotations? Something like below
I took above example from TypeGraphQL that allows creation of annotation based Apollo GraphQL schema. My initial analysis suggests, I cannot use the same library to generate AppSync schema.
Please let me know if any library/application exists that will allow me to generate AppSync schema using annotations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In one of our upcoming projects, my team is going to use CDK TypeScript, AppSync, nodeJS Lambda, TypeORM as Layer and Provisioned Aurora as the tech stack.
At the time of POC, we created
(1) AppSync schema using code-first approach,
(2) TypeORM entities using annotations
(3) connected lambda to database using TypeORM repository commands
One of the observations was redundancy in the declared schema/entity fields.
Example
Notice duplication of Rate object and member fields above. For each new field added to TypeORM Rate entity, we need to add it to the ObjectType created below.
Question: Is it possible to generate AppSync schema using annotations? Something like below
I took above example from TypeGraphQL that allows creation of annotation based Apollo GraphQL schema. My initial analysis suggests, I cannot use the same library to generate AppSync schema.
Please let me know if any library/application exists that will allow me to generate AppSync schema using annotations.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions