How do you create child resolvers in AppSyncApi?
# sst
g
How do you create child resolvers in AppSyncApi?
f
Hey @Gerald, I’m not too familiar with AppSync. Have you come across this https://stackoverflow.com/questions/52512011/aws-appsync-pass-arguments-from-parent-resolver-to-children?
g
I don't know how to define it in AppSyncApi. I tried below but no luck hehehe!
type Menu {
name: String!
}
input MenuWhereInput {
name: String
}
type Category {
_id: String!
name: String!
menu(_where_: MenuWhereInput): [Menu!]
}
type Query {
categories: [Category!]
}
this.api = new AppSyncApi(this, "AppSyncApi", {
graphqlApi: {
schema: [
'src/api/graphql/schema/category.graphql'
],
},
dataSources: {
category: "src/api/graphql/category/main.handler"
},
resolvers: {
"Query categories": "category",
"Query <http://categories.menu|categories.menu>": "category"
}
});
f
Is there an example you are following showing how to set it up in AWS console, or in CloudFormation, or using any other serverless frameworks?